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

245
Views
How to update another sheet in App Script using openById() method

Here is my code can you help what did I do wrong with my code: the function texFinder(sheet = "ASC", findText = "abc12345"){...} works fine but it is not working when I call the fun.

function textFinder(sheet, findText) {

  var sheetstolook = SpreadsheetApp.openById('1ifE_iXM9RJJBiHOQdpSlKnvGcnkvFk').getSheetByName(sheet).activate();

  var SHTvalues = sheetstolook.createTextFinder(findText).findAll();

  var result = SHTvalues.map(r => ({ row: r.getRow(), col: r.getColumn() }));

  var toupdate = sheetstolook.getRange(result[0].row, result[0].col + 1).getValue();

  sheetstolook.getRange(result[0].row, result[0].col + 1).setValue(toupdate - 1);

  if (parseInt(toupdate) < 0) {
    sheetstolook.getRange(result[0].row, result[0].col + 1).setBackgrounds('red');
  }

}
function onEdit(e){
...
    else if (col == 9 && e.source.getActiveSheet().getRange(row, 5).getValue().toUpperCase() === "FRM") {
    
    
    
        var shsearch = e.source.getActiveSheet().getRange(row, 4).getValue().toUpperCase();
        var shTxt = e.source.getActiveSheet().getRange(row, 9 ).getValue();
        
    
        textFinder(shsearch, shTxt);
        
      }
}
about 4 years ago · Juan Pablo Isaza
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!