Quantcast
Channel: Hot Weekly Questions - Web Applications Stack Exchange
Viewing all articles
Browse latest Browse all 9782

Moving row of completed task to specific "completed" google sheet when using multiple sheets

$
0
0

I'm a construction worker trying to create an apps scripts for our work task list in google sheets. My code is below (this code worked when there were just 2 sheets (task list & completed task list). Once I added multiple job task sheets (along with multiple "completed" task sheet, the code doesn't work anymore. I've tried adding sheet names, but it still didn't work, so I rolled it back to this initial script that did work (for 2 sheets only).

sample spreadsheet

function onEdit(e){  if (!e) throw "Do not run from Editor. This function runs automatically whenever an edit is made."  moveToCompleted(e);}function moveToCompleted(e){  const src = e.source.getActiveSheet();  const r = e.range;  if (src.getName() != "CochranTaskList","CartisanoTaskList" || r.columnStart != 1 || r.rowStart < 4) return;  const dest = SpreadsheetApp.getActive().getSheetByName("CompletedCochranTasks","CompletedCartisanoTasks");  src.getRange(r.rowStart,1,1,3).moveTo(dest.getRange(dest.getLastRow() +1, 1,1,3));  src.deleteRows(r.rowStart);}

Viewing all articles
Browse latest Browse all 9782

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>