I should automate so that on sheet2 it looks for the last written row, and then copies the whole row in sheet2 into row2. I have done this but I cannot paste a single line. you can help me.
const ss=SpreadsheetApp.getActive();
const sh=ss.getSheetByName('Sheet2');
const tsh=ss.getSheetByName('Sheet3');
tsh.clearContents();
const rg=sh.getRange(5,1,sh.getLastRow()-4,sh.getLastRow());
const vs=rg.getDisplayValues();
const ss=SpreadsheetApp.getActive();
const sh=ss.getSheetByName('Sheet2');
const tsh=ss.getSheetByName('Sheet3');
tsh.clearContents();
const rg=sh.getRange(5,1,sh.getLastRow()-4,sh.getLastRow());
const vs=rg.getDisplayValues();
Last edited by a moderator: