I have a google sheet where I have around 50-60 more tabs. All the data in those sheets is in the same format, I just need to merge together into a master spreadsheet. I tried the second answer here but it throws me an error with the excess time limit. It is pretty slow because it pastes every row - so it exceeds the time limit. I am trying to use the getValues
and setValues
function to do it, but I have issues figuring out how to append after the lastRow
and lastColumn
. Here is the code -
var ss = SpreadsheetApp.getActiveSpreadsheet();
var All = ss.insertSheet("MergedMasterSheet");
function TotalsSheet() {
var sheets = ss.getSheets();
for (var i=0; i < sheets.length; i++)
{
var sheet = sheets[i];
var range = sheet.getDataRange();
var values = range.getValues();
var lastrow = All.getLastRow();
var lastcolumn = All.getLastColumn();
// All.getRange().setValues(values) here is the problem with the
getRange() function
}
}