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

145
Views
How to search many sheets?

I have one main Google spreadsheet that has many sheets inside it, I am using a google script to search for specific data using name/password but I need to apply the search on all sheets in this main spreadsheet, please help me how to figure this out :

var sheetName = "Data"
  
var range = SpreadsheetApp.openById(spreadsheetId).getSheetByName(sheetName).getDataRange();
var data = range.getValues();
var ar = [];
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

I believe your goal as follows.

  • You want to search a text from all sheets in a Google Spreadsheet.

In this case, I would like to propose to use TextFinder. When TextFinder is used, the text can be searched from all sheets in a Google Spreadsheet. The sample script is as follows.

Sample script:

function myFunction() {
  const spreadsheetId = "###"; // Please set Spreadsheet ID.
  const searchText = "sample"; // Please set the seatch text.

  const ss = SpreadsheetApp.openById(spreadsheetId);
  const ranges = ss.createTextFinder(searchText).matchEntireCell(true).findAll();
  const res = ranges.map(r => ({sheet: r.getSheet().getSheetName(), range: r.getA1Notation()}));
  console.log(res)
}
  • When this script is run, the list of the sheet name and a1Notation is returned. About this, please modify it for your actual situation.

References:

  • createTextFinder(findText) of Class Spreadsheet
  • Class TextFinder
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!