How to Auto hidea range of multiple rows based in values?

December 7, 2016 at 14:52:02
Specs: Windows
Hi guys,

How do I hide Automatically multiple Rows if a value is 0,

Example:

Hide
B1
B20
IF
C20=0

AND

Hide
B2
B21
IF
C21=0

...

AND

Hide
B19
B39
IF
C39=0

I was able to do this with this code, but I must run manually each time:

Sub HideRows()
With Sheets("CONTROL")
    .Rows(1).Rows.Hidden = Sheets("CONTROL").Range("C20").Value = "0"
    .Rows(20).Rows.Hidden = Sheets("CONTROL").Range("C20").Value = "0"
    .Rows(2).Rows.Hidden = Sheets("CONTROL").Range("C21").Value = "0"
    .Rows(21).Rows.Hidden = Sheets("CONTROL").Range("C21").Value = "0"
End With

End Sub

Tanks in advanced.

message edited by fgualdron


See More: How to Auto hidea range of multiple rows based in values?

Report •

#1
December 7, 2016 at 17:41:58
I'm not sure what you mean by "automatically". When do you want this happen?

It also looks like you are hiding individual rows, not a range of rows.

Could you please explain your requirements in a little more detail?

Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.


Report •
Related Solutions


Ask Question