I'd appreciate some help on my first google script if possible.
I'm trying to archive our daily processing log by copying and pasting them to the bottom of an end of day log spreadsheet.
The issue is that the number of rows processed each day will vary so I can't set a fixed number of rows to copy to the target spreadsheet.
I just want to copy from row B7 down to the last row with values entered.
function pasteprocessinglog() {
var sss = SpreadsheetApp.getActiveSpreadsheet();
var ss = sss.getSheetByName('Sheet_name');
var range = ss.getRange('B7:J');
var data = range.getValues();
var tss = SpreadsheetApp.openById('URL');
var ts = tss.getSheetByName('Processing Log');
ts.getRange(ts.getLastRow() + 1, 2, ss.getMaxRows(), 9).setValues(data);
}
I'm currently receiving error: Incorrect range height, was 6467 but should be 6473
I'm guessing this is because it's trying to copy the empty rows too and the spreadsheet isn't long enough.
Any help would be appreciated :)
Thank you!