Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

275
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda