Answer the question
In order to leave comments, you need to log in
How to change cell settings on multiple sheets at the same time?
Tell me, is it possible to somehow change the parameters of the cells at the same time on several (all) sheets of the Google spreadsheet. In Excel, sheets can be selected using the Ctrl key, how to do this in Google Spreadsheet?
Answer the question
In order to leave comments, you need to log in
I usually do this:
1) I make a draft code for one sheet. It may even be a reworking of the macro recorder code
2) I run it on all sheets, except for the "black list"
/**
* Выполняет действия на всех листах, кроме тех, которые указаны в blackList
* [ ProgrammerForever (c) 2020 ]
* @return Не возвращает значений
*/
function listChanger(){
var ss = SpreadsheetApp.getActiveSpreadsheet();
var blackList = ["Настройки", "Data"];// Чёрный список. На этих листах действий не будет
var sheets = ss
.getSheets()
.map(sheet=>sheet.getName())
.filter(sheetName=>blackList.indexOf(sheetName)===-1);
for(var sheetIndex in sheets){
var currentSheet = ss.getSheetByName(sheets[sheetIndex]);
//Что-то делаем с currentSheet
};
};
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question