How to call multiple sheets with the same script? (Apps Script)

Is 2-SMS-Vorlage an exact match for the name of the sheet, including case and whitespace?

Just as an aside, I would move this line…

var ss = SpreadsheetApp.getActiveSpreadsheet();

…outside the forEach() loop. ie. move it up to line 6. It should still work the way you have it, but creating a new ss object on every iteration of the loop is wasteful.

2 Likes