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

226
Vistas
Is there a way to get the "parent" Spreadsheet which triggered the code?

I have a script that executes a code, i've attached it to some buttons in differents sheets and inside this code i need to get the sheet name that contains the buttom that triggered the script. Is there a way to get it?

I've coded this so far:


  let sht = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Escopo - Financeiro");

  var nomeDoc = sht.getRange("A2").getValue();
  var modulo = sht.getRange("B1").getValue();

So i need to change the .getSheetByName("Escopo - Financeiro") code to fit my needs.

I was wondering if i could use some certain of "this" or "parent" statement, but i havent found it.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

So since i've bounded my script to a button which is into an active spreadsheet, replacing the SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Escopo - Financeiro"); part of the code to SpreadsheetApp.getActiveSpreadsheet().getActiveSheet(); solved the problem.

about 4 years ago · Juan Pablo Isaza 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