Looking to move data from one spread sheet to a seperate spreadsheet in Google Docs using a checkbox.
The following code that I have got working as far as moving that data from one doc to the other with the checkbox. I'm stuck with getting it to move from a certain cell in the first sheet to the exact same cell in the second sheet.
Thanks in advance for any help.
function moveRowOnCheck(e) {
const src = e.source.getActiveSheet();
const r = e.range;
if (src.getName() != 'Sheet1' || r.columnStart != 3 || r.rowStart == 1 || e.value != 'TRUE') return;
const ui = SpreadsheetApp.getUi();
const res = ui.alert("Move row?", ui.ButtonSet.YES_NO);
if (res == ui.Button.NO) {
r.uncheck();
return;
}
const dest = SpreadsheetApp.openById("SheetID").getSheets()[0];
//src.getRange(r.rowStart, 1, 1, 3).moveTo(dest.getRange(dest.getLastRow() + 1, 1, 1, 3));
dest.getRange(dest.getLastRow()+1,1,1,3).setValues (r.offset(0,-2,1,3).getValues());
src.deleteRow(r.rowStart);
}