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

260
Visualizações
How can I hide rows in more than one Sheet using Apps Script?

I have been creating a complex spreadhseet on Google sheets that uses data from one 'tab' to populate information in other 'tabs'.

The way I have done this leaves gaps in the tables in the other 'tabs' and therefore I would like to be able to hide all of the rows that have gaps, in all of those specific 'tabs'.

/** @OnlyCurrentDoc */

function onOpen() {
  SpreadsheetApp.getUi().createMenu("Custom Filter")
    .addItem("Filter rows", "filterRows")
    .addItem("Show all rows", "showAllRows")
    .addToUi();
}

function filterRows() {
  var sheet = SpreadsheetApp.getActive().getSheetByName("Jordan"); //Here, I need to find a way to specify more than one sheet
  var data = sheet.getDataRange().getValues();
  for(var i = 5; i < data.length; i++) {
    //If column B is blank then hide the row.
    if(data[i][1] === "") {
      sheet.hideRows(i + 1);
    }
  }
}

function showAllRows() {
  var sheet = SpreadsheetApp.getActive().getSheetByName("Jordan");
  sheet.showRows(1, sheet.getMaxRows());
}
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