• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User


  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Button to hide rows based on specific cells having a qty of "0"

I am a lighting designer for an event venue.

I have an excel document that is an equipment list I use to generate Request for Quotes to submit to vendors.

Essentially its a long list of every possible light, cable, power distro possible.

I fill in qtys, then manually hide rows that are not used for a specific list. Its really tedious and prone to user selection errors currently.

I have an example file here, with the button and the code I have been trying to use.

>>> use code - tags <<<
Private Sub CommandButton1_Click()

For a = 23 To 609

If Worksheets("Typical").Cells(a, 24).Value = "0" Then

Worksheets("Typical").Rows(a).Hidden = True

End If


End Sub
This code is not working as I would like currently.

There are also row headers that I would also like the ability to hide with the same button if inactive. They have 0 values in the q column instead of the a column as a normal line item would.

Any help/advice greatly appreciated. I've used excel all my life, but basically only on a surface level.

I believe I have attached an example file.


Last edited by a moderator:
This was exactly what I was trying to do.
Thanks so much. Sorry for the delay in extending thanks.
Using this for a lot of my stuff now. Thank you!

I had to modify the code a little bit to get it to hide or keep headers, but most of that was error stuff on my part.
The things you can do with simple sum formulas.