• 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

    Hui...

  • 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 <<<
Code:
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

Next

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.
 

Attachments

  • Hide Help Example File.xlsm
    184.8 KB · Views: 1
Last edited by a moderator:
redshiftcreation
One sample...
Press the button to show/hide rows as You wrote.
You can see hiding - instead of pure waiting action.
You had an ActiveX-component, which I cannot use - - that's why this sample is in other format.
Ps. I cleaned some rows from Your Macro1 - there should clean more.
 

Attachments

  • Hide Help Example File.xlsb
    108.1 KB · Views: 6
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.

Thanks!
 
redshiftcreation
...hmm?
If it was as Your wrote exactly what I was trying to do.
... then why did You modify the code a little bit to get ...
I modified something that I could delete those sum formulas and so on...
 

Attachments

  • Hide Help Example File.xlsb
    106.5 KB · Views: 0
Back
Top