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

256
Visualizações
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
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