Thread
:
Help with a hide row macro (not using filter)
View Single Post
#
2
Don Guillett
Posts: n/a
Using that method, try it this way
Sub Hide_Print_Unhide()
Dim rw As Long
Application.ScreenUpdating = False
With Sheets("Sheet1")
For rw = 1 To 300
If Application.CountA(Range(.Cells(rw, 1), .Cells(rw, 8))) = 0
Then _
.Rows(rw).Hidden = True
Next rw
.PrintOut
.Range("A1:A300").EntireRow.Hidden = False
End With
Application.ScreenUpdating = True
End Sub
--
Don Guillett
SalesAid Software
wrote in message
ups.com...
Can anyone help with this macro ?
I need it to hide any rows which have a value of 0 in cols A to H
I DON'T want to use filters.
Every time I run it, nothing is hidden
Thanks in advance
Sub Hide_Print_Unhide()
Dim rw As Long
Application.ScreenUpdating = False
With Sheets("Sheet1")
For rw = 1 To 300
If Application.WorksheetFunction.CountA( _
.Cells(rw, 1).Range("A1:H1")) = 0 Then _
.Rows(rw).Hidden = True
Next rw
.PrintOut
.Range("A1:A300").EntireRow.Hidden = False
End With
Application.ScreenUpdating = True
End Sub
Reply With Quote