I'm having trouble editing this code to get it to edit multiple sheets at the same time. It works for whatever is active, but I'd like to disable that and have it work on each tab named after each month and when I'm trying to use getSheetByName()
, it doesn't seem to work. Here's the code that does work:
function onOpen() {
SpreadsheetApp.getUi()
.createMenu('Reset sheet')
.addItem('Remove all metrics', 'userActionResetByRangesAddresses')
.addToUi();
}
function userActionResetByRangesAddresses() {
var sheet1 = SpreadsheetApp.getActiveSheet();
var rangesAddressesList = [
'D4:E53',
'I4:I53',
'M4:O53',
'D60:E109',
'I60:I109',
'M60:O109',
'D116:E165',
'I116:I165',
'M116:O165',
'D172:E221',
'I172:I221',
'M172:O221',
'D228:E277',
'I228:I277',
'M228:O277'
];
resetByRangesList_(sheet1, rangesAddressesList);
}
function resetByRangesList_(sheet1, rangesAddressesList) {
sheet1.getRangeList(rangesAddressesList).clearContent();
}
each tab named after each month
?