I have a Spreadsheet that contains a lot of sheets, and i need to load one of these sheets in my script, how i do that?
here is a photo of the sheets in my Spreadsheet
here is my idea how to do it
var sheet = SpreadsheetApp.openById(index).getSheetByName('Geração de Demanda');
is that?
Thank you.
You're almost there... what you want is to make that sheet 'active' so try this :
I know this is an old question. But still... var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheets()[1];
I guess this is the most convenient way, as you dont have to deal with name, just indicate sheet number... [1] indicates second sheet... As you may guess numbering starts from 0 and on...