Hi I have 2 spreadsheets, for example, one is called 'test' and the other 'test1'. I want when checkbox is checked for a row on spreadsheet 'test', the entire row moves to 'test1' spreadsheet. I used this script and it works perfectly if I want the row to move to another sheet in the 'test' spreadsheet.
function onEdit(e) {
const src = e.source.getActiveSheet();
const r = e.range;
if (src.getName() != "New" || r.columnStart != 6 || r.rowStart == 1) return;
const dest = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Complete");
src.getRange(r.rowStart,1,1,6).moveTo(dest.getRange(dest.getLastRow()+1,1,1,6));
src.deleteRow(r.rowStart);
}
But when I change it to this script so the row is moved from 'test' to 'test1' it does not work. I can't seem to figure out the solution. Can anyone help - thanks so much!
function onEdit(e) {
const src = e.source.getActiveSheet();
const r = e.range;
if (src.getName() != "New" || r.columnStart != 6 || r.rowStart == 1) return;
const dest = SpreadsheetApp.getActiveSpreadsheet("19D-PzL-
YGdRQbXdGeILMeUbHFJkxeMFan0di7eSqK6E").getSheetByName("Sheet1");
src.getRange(r.rowStart,1,1,6).moveTo(dest.getRange(dest.getLastRow()+1,1,1,6));
src.deleteRow(r.rowStart);
}
Aucun commentaire:
Enregistrer un commentaire