V
V
Viktor2020-06-09 10:05:03
Google Sheets
Viktor, 2020-06-09 10:05:03

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

2 answer(s)
G
Grigory Boev, 2020-06-09
@ProgrammerForever

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
  };
};

A
Alexander Ivanov, 2020-06-09
@oshliaer

There is no such thing in Tables. Probably not yet.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question