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

227
Visualizações
I am trying to apply a script to the rest of the columns in the google sheet. Goal is that anytime a checkmark is applied the row is then hidden

At the moment I am using the following code so that every time a check box is marked off in a column then the whole row is hidden. At the moment the script I have only works for one column and not for any other column. I would like the script to work for any column I choose. I am using Google Sheets.

function onEdit(e){
if (e.range.columnStart != 6 || e.value != "TRUE") return;
SpreadsheetApp.getActiveSheet().hideRows(e.range.rowStart);
 }
about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

I believe your goal is as follows.

  • You want to hide the row when the checkbox is checked. In this case, the checkboxes are put not only in the column "F" but also in other columns. You want to use the other checkboxes.

In this case, how about the following modification?

Modified script:

This modified script uses the checkboxes of all columns.

function onEdit(e) {
  const {range} = e;
  if (!range.isChecked()) return;
  range.getSheet().hideRows(range.rowStart);
}

This modified script uses the checkboxes of the columns "B", "D" and "F".

function onEdit(e) {
  const columns = [2, 4, 6]; // In this case, the columns "B", "D" and "F".

  const {range} = e;
  if (!columns.includes(range.columnStart) || !range.isChecked()) return;
  range.getSheet().hideRows(range.rowStart);
}

  • When you use this script, please check the checkboxes. By this, the script is run by a simple trigger. When you directly run the script, an error occurs. Please be careful about this.
about 4 years ago · Juan Pablo Isaza Relatório

0

function onEdit(e) {
  const sh = e.range.getSheet();
  if (sh.getName() == 'Sheet0' && e.range.columnStart == 6 && e.value == "TRUE") {
    sh.hideRows(e.range.rowStart)
  }
}
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