I'm looking for a script that will automatically open a Google Sheet to the last row/first column every time you open the entire worksheet and every time you switch through the sheet tabs.
I've tried copying the following code I found online into Google's Script Editor, but I receive an error:
function onOpen(e) {
var spreadsheet = e.source;
var sheet = spreadsheet.getActiveSheet();
var lastRow = spreadsheet.getLastRow();
var range = sheet.getRange("A" + lastRow + ":A" + lastRow);
sheet.setActiveRange(range);
}
TypeError: Cannot read property "source" from undefined. (line 2, file "Code")