Macro to Hide Rows


Posted by Michelle on January 07, 2002 7:54 AM

Is there a way to hide rows with a macro where the rows contain 0.



Posted by Tom Urtis on January 07, 2002 8:07 AM

Good morning Michelle,

See if this is what you want.

Sub HideZeros()
Dim i As Integer
For i = 1 To Range("D65536").End(xlUp).Row
If Cells(i, 4).Value = "0" Then Rows(i).Hidden = True
Next
End Sub

It assumes column D is the column being evaluated for zeros.

Any help?

Tom Urtis