How to get sheet that is not first sheet?

Viewed 8589

I am new to Google scripting, so I apologize if this is a naive question. I do not know how to get a variable reference to a sheet within a spreadsheet that is not the first sheet.

In my spreadsheet, I have two sheets, Agenda and Info. Agenda is the first sheet(index 0) and Info is the second. I can get a reference to Agenda, but I cannot get a reference to Index. This is the code I have tried:

var info_sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Info');

info_sheet.getName() always comes out being Agenda, though. What do I do?

1 Answers
Related