Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

273
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!