Jay
I use the follwong code to achieve what you want:
Sub CleanSheetHideRows()
Dim nCol As Integer
Dim J As Integer
Application.ScreenUpdating = False
With ActiveSheet
.Range("B4").Select
nCol = 2
For J = 4 To 6000
If .Cells(J, nCol).Value = 0 Then
.Cells(J, nCol).Select
Selection.EntireRow.Hidden = True
End If
Next J
End With
Application.ScreenUpdating = True
End Sub
B4 specifies where to start from.
nCol is the column number. So 2 is Column B
This code will hide ROWS that equal 0.
If you want to hide COLUMNS do the following:
Sub CleanSheetHideRows()
Dim nRow As Integer
Dim J As Integer
Application.ScreenUpdating = False
With ActiveSheet
.Range("B4").Select
nRow = 2
For J = 2 To 6000
If .Cells(J, nRow).Value = 0 Then
.Cells(J, nRow).Select
Selection.EntireRow.Hidden = True
End If
Next J
End With
Application.ScreenUpdating = True
End Sub
I am sure that more competent person will be able to simplify this code
or help more accuratly! :)
--
Petitboeuf
------------------------------------------------------------------------
Petitboeuf's Profile:
http://www.excelforum.com/member.php...o&userid=10602
View this thread:
http://www.excelforum.com/showthread...hreadid=399444