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

225
Visualizações
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 Respostas
Responde à pergunta

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 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