Answer the question
In order to leave comments, you need to log in
How to Foreach over all Spreadsheets of a Table in Google Script Spreadsheets?
I know how to take only the active sheet
var sheet = SpreadsheetApp.getActive();
And how to do foreach or for on all available sheets?
Answer the question
In order to leave comments, you need to log in
const sheets = SpreadsheetApp.getActiveSpreadsheet().getSheets();
for(const sheet of sheets) {
Logger.log(sheet.getName());
}
sheets.forEach(function(sheet) {
Logger.log(sheet.getName());
});
while(sheets.length) {
const sheet = sheets.shift();
Logger.log(sheet.getName());
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question