• 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.

hiding of unnecessary rows

Hi All,

Please help me come up with a formula that hides rows with zero (0) values.

Kindly see attached file and thank you in advance.
 

Attachments

  • NZ File.xlsx
    13.4 KB · Views: 0
Rhon

Your table is currently 56 rows high with only 3 rows of data > 0

Do you want the table to be:

a) 3 rows high with the other rows hidden
b) 3 rows high with the other rows accessible using a +/- icon
c) 56 rows high with the 0 values not visible

I also assume you'll need some technique to unhide or make all rows visible
 
You can use some simple VBA code like
Code:
Sub HideRows()

Dim c As Range
For Each c In Range("B4:B59")
  If c.Value = 0 Then c.EntireRow.Hidden = True
Next


End Sub

Code:
Sub UnHideRows()
Range("B4:B59").EntireRow.Hidden = False

End Sub

Then link that to some buttons
see attached file:
 

Attachments

  • NZ File-1.xlsm
    20.7 KB · Views: 2
Hi Hui,

Actually, I need all the product mode be included on the lists and hides only when we have no sales for the year. your VBA Code works great and this is just what I needed with your letter A parameter. unfortunately, I am not familiar yet and I don't know how VBA works so I think I have to study it. :) :)

thanks for the help!!
 
Back
Top