Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

274
Visualizações
How to get all sheets by openById while standalone

I am trying to make a standalone script to action for another spreadsheet. It's working for 1st sheet only but it's not working for all sheets.

 function doSomething(){
    var ssID = "123abc";
    var ss = SpreadsheetApp.openById(ssID);
    var sheet = ss.getActiveSheet(); //var sheet = ss.getActiveSpreadsheet().getSheets(); I tried it also, but giving error.         
    var range = sheet.getRangeList(['A3:A','D3:D']);
    range.setFontFamily("Arial");
    //Rest do something
    }
    

I need an example to work all sheets and need work all except individual sheets.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

If you want to loop through all the sheets and set the font for the range it can be done this way:

function doSomething(){
  var ssID = "123abc";
  var ss = SpreadsheetApp.openById(ssID);
  var sheets = ss.getSheets();
  var sheets_to_skip = ['aaa', 'bbb']; // names of the sheets you want to skip

  sheets.forEach(sheet => {
    if (!sheets_to_skip.includes(sheet.getName())) {
      var range = sheet.getRangeList(['A3:A','D3:D']);
      range.setFontFamily("Arial");
    }
  })
}
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda