Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

93
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda