Home > Back-end >  Hide rows based on multiple checkbox values
Hide rows based on multiple checkbox values

Time:10-21

The project I am working on is to calculate costs of remaining sets in a mobile game. It has a spreadsheet with a list of all the sets, and checkboxes for all 5 pieces, Columns B:F. I want to include the option to hide all sets that are completed, so all Checkboxes are checked. This is done via another Checkbox, H16.

I have modified the Checkbox values to use Yes and No.

I have never used Google Apps Script before, and am very new to coding in general. I think what I need is, to use onEdit, then every time a cell is edited, check if H16 is TRUE, then scan through each row to check the B:F values. If all are true, hide that row. I don't know the best way to type that out, though.

Bonus points, I also want to include a reset checkbox, so when checked, set all values in B:F to false, and show the rows. enter image description here

I use K1 to provide me with the event object while I debug the script. And I also use the e.source.toast in several location to get an idea of what is going on.

Animation:

enter image description here

an incomplete description of the event object

You can get a better understanding of the event object by using the JSON.stringify code as show in my example.

Most new people want to run the code from the script editor so I'll tell upfront that unless you provide the event object to populate the e then it's not going to work. Just copy and past it and get you unique stuff set like sheet name and data space and then proceed to edit the page and figure out how it works.

  • Related