I am using the code below to hide rows that are not relevant to print and/or copy just relevant data to another sheet.
The code below looks at all the rows in Col A and if they =0 it hides the rows.
This seems to be taking a lot longer than it initially did.
It looks through approx. 2000 rows.
Can it be made faster or some progress bar added?
Thanks
DK
The code below looks at all the rows in Col A and if they =0 it hides the rows.
This seems to be taking a lot longer than it initially did.
It looks through approx. 2000 rows.
Can it be made faster or some progress bar added?
Code:
Sub PrintBudgetRows()
Dim cel As Range
Dim rng As Range
'Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
Set rng = Sheets("Budget").Range("A10", Range("EndOfBudgetRange"))
rng.AutoFilter Field:=1, Criteria1:="<>0"
For Each cel In rng
If cel.Value = 0 Then
cel.EntireRow.Hidden = True
End If
Next cel
Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic
End Sub
Thanks
DK