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

106
Visualizações
Set cell values in two different sheets upon action in third sheet

Thanks for your help in advance. New to scripting. Trying to set values to true in two sheets that correspond to a value in a row from a source sheet.

Example: Sheet 1 gets a row added, corresponding Sheets 2 and 3 get a column set to true.

I do not have a script example to display

about 4 years ago · Santiago Gelvez
1 Respostas
Responde à pergunta

0

ADD ROW set two columns to "TRUE"

When user adds a row to Sheet0 the next row in Sheets 2 and Sheet3 and column one get set to "TRUE"

function onMyChange(e) {
  //Logger.log(JSON.stringify(e));
  const sh = e.source.getActiveSheet();
  if (sh.getName() == 'Sheet0' && e.changeType == "INSERT_ROW") {
    let sh2 = e.source.getSheetByName('Sheet2');
    if (sh2.getLastRow()) {
      sh2.getRange(sh2.getLastRow() + 1, 1).setValue("TRUE");
    } else {
      sh2.getRange(1,1).setValue("TRUE");
    }
    let sh3 = e.source.getSheetByName('Sheet3')
    if (sh3.getLastRow()) {
      sh3.getRange(sh3.getLastRow() + 1, 1).setValue("TRUE");
    } else {
      sh3.getRange(1,1).setValue("TRUE")
    }
  }
}

You can goto to Google Apps Script Reference and using the search box find any function that you don't understand. If it's a pure JavaScript function then go here

about 4 years ago · Santiago Gelvez Relatório
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