Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

226
Views
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 answers
Answer question

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 Report

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!