I want to make a script for my google spreadsheet that copy a range of data from sheet1 to the last empty row in Sheet2 ( column a). I don't know what is wrong, i get this error: error I'm a novice in programming.
function copy() {
const ss = SpreadsheetApp.getActive();
const sh = ss.getSheetByName('Sheet1')
const rg = sh.getActiveRange();//you select the range before running the script
const vs = rg.getValues();
const tsh = ss.getSheetByName('Sheet2');
tsh.getRange(tsh.getLastRow() + 1, 1,vs.length,vs[0].length).setValues(vs);
}