r/googlesheets • u/Used-Doubt-6081 • Nov 01 '25
Unsolved Google Sheets Apps Script not triggering between tabs
Hey everyone,
I’m trying to automate something simple in my Google Sheet, but the script just won’t trigger properly when I edit a cell.
I have two tabs in the same Google Sheet:
- “The Backlog Vault” → where I track games I’m playing or plan to play

- “Games” → where I keep my completed games

Here’s what I want to happen:
- When I change the Status column (B) in “The Backlog Vault” to “Complete”, → that row should automatically move to the “Games” tab.
- It should also automatically fill today’s date in column C (“Date Finished”), prevent duplicates, and delete the row from “The Backlog Vault”.
Here’s the script I’m using:
function onEdit(e) {
if (!e) return;
const wsSource = "The Backlog Vault";
const wsTarget = "Games";
const statusCol = 2;
const dateCol = 3;
const ss = e.source;
const sheet = ss.getActiveSheet();
if (!sheet || sheet.getName() !== wsSource) return;
const range = e.range;
if (range.columnStart !== statusCol) return;
const row = range.rowStart;
const status = e.value;
if (status !== "Complete") return;
const sourceSheet = ss.getSheetByName(wsSource);
const targetSheet = ss.getSheetByName(wsTarget);
if (!sourceSheet || !targetSheet) return;
const lastCol = sourceSheet.getLastColumn();
const rowValues = sourceSheet.getRange(row, 1, 1, lastCol).getValues()[0];
const gameName = rowValues[0];
if (!gameName) return;
const targetLastRow = Math.max(targetSheet.getLastRow(), 1);
const targetNamesRange = targetSheet.getRange(1, 1, targetLastRow, 1).getValues().flat();
if (targetNamesRange.includes(gameName)) {
sourceSheet.getRange(row, statusCol).setValue("Already in Games");
return;
}
const date = new Date();
rowValues[dateCol - 1] = Utilities.formatDate(date, Session.getScriptTimeZone(), "yyyy-MM-dd");
targetSheet.appendRow(rowValues);
sourceSheet.deleteRow(row);
}But whenever I try it, nothing happens when I mark a cell “Complete.”
I’ve already Tried making an installable trigger (“From spreadsheet > On edit”)
Still nothing.
What am I missing here?
2
Upvotes
View all comments
Show parent comment
2
u/mommasaidmommasaid 914 Nov 02 '25
Yes, idk if you saw the link in my post but I did pretty much all that in the V2 sample sheet so you may want to just steal that, that's what it's there for. :)
Also, you can have multiple script files in your project, there's nothing wrong with that.
Just make sure there's only one onEdit() in your entire project. If you need to trap different kinds of edits, I recommend repeatedly calling multiple functions from within the one onEdit()
I've updated my sample script to show one technique for doing that:
Game Tracker V2