Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel hide row if 0

Status
Not open for further replies.

lous

Technical User
Mar 8, 2002
53
US
I'm looking for an Excel macro that will look at a column of numbers and if the number is 0 in that column, it will hide that row (record) from view.

Any ideas?
 
Highlight the data in the column
and run the following macro

Sub hidrow()
Dim currentcell As Object
For Each currentcell In Selection
If currentcell.Value = 0 Then
currentcell.EntireRow.Hidden = True
End If
Next currentcell

End Sub


HNY
 
Using the default AUTOFILTER in XL would be much easier/faster...Find it in the menu bar. [yinyang] Tranpkp [pc2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top