How do I set the last sheet in my spreadsheet to the active sheet? This code isn’t working. Not sure what I’m doing wrong…
var logbook = SpreadsheetApp.openById("my key code");
var totalSheets = logbook.getNumSheets();
var lastSheet = logbook.getSheets[totalSheets];
var currentSheet = logbook.setActiveSheet(lastSheet);
I’m getting an error:
Can not find method setActiveSheet
Try it like this instead :
that said, it seems complicated to access a single sheet… what I do usually is simply that :
that’s pretty standard in a lot of example code…