Recipe
Move a row to another tab when its status changes
When a Status cell in column E of the Open tab becomes Done, that row is copied to the bottom of the Done tab and removed from Open.
Set it up
- Make two tabs named Open and Done with the same headers. Put Status in column E.
- Paste the script into Extensions > Apps Script and save.
- Change a Status cell to Done. The row moves. No trigger setup is needed.
The script
/**
* Move a row to another tab when its Status cell changes to a target value.
* Works as a simple onEdit trigger (it only touches this spreadsheet).
*/
var MV = { fromSheet: 'Open', toSheet: 'Done', statusCol: 5, statusValue: 'Done' };
function onEdit(e) {
if (!e || !e.range) return 'skip:no-event';
var range = e.range;
var sheet = range.getSheet();
if (sheet.getName() !== MV.fromSheet) return 'skip:sheet';
if (range.getColumn() !== MV.statusCol || range.getRow() < 2) return 'skip:cell';
if (String(e.value) !== MV.statusValue) return 'skip:value';
var target = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(MV.toSheet);
if (!target) return 'skip:no-target-sheet';
var row = range.getRow();
var values = sheet.getRange(row, 1, 1, sheet.getLastColumn()).getValues()[0];
target.appendRow(values);
sheet.deleteRow(row);
return 'moved';
}Test status. 3 of 3 automated checks pass, run Nov 2026 against simulated Google services. This recipe has not yet been run inside a live Google account. Test it on a copy of your sheet first.
What you should see
| Task | Owner | Status |
|---|---|---|
| Renew domain | Ops | Done |
| Send invoices | Ana | Done |
Row 4 moved to Done. Sample values, not output from a real account.
Common errors and fixes
- Nothing happens
- The function must be named onEdit, and the value must match statusValue exactly.
- A row vanished
- It moved. Look at the bottom of the Done tab. Use Edit > Undo if it was a mistake.
- Pasted values do not trigger it
- Edits made by scripts or imports do not fire onEdit. Type or paste in the sheet.
Permissions. Running this script asks you to grant Google permissions for the services listed above, to your own script. TriggerShelf never receives your Google data. See the permissions table. Google will show "Google hasn't verified this app"; that is expected for a script you paste yourself.
TriggerShelf is independent and not affiliated with or endorsed by Google LLC. Google Sheets, Gmail, Google Drive and Apps Script are trademarks of Google LLC. Quota figures come from Google's Apps Script quotas page. Test on a copy first.