I have a procedure that tests a range and where it finds an empty cell it hides the row. Works instantly upon loading but after printing or even print preview it takes about 20 seconds to run. Any ideas?? Here's the code.
Public Sub Hide()
LastRow = ActiveSheet.UsedRange.Row - 1 + _
ActiveSheet.UsedRange.Rows.Count
Application.ScreenUpdating = False
For r = LastRow To 7 Step -1
If IsEmpty(Range("C" & r).Value) Then
Rows(r).Hidden = True
End If
Next r
End Sub
Public Sub Hide()
LastRow = ActiveSheet.UsedRange.Row - 1 + _
ActiveSheet.UsedRange.Rows.Count
Application.ScreenUpdating = False
For r = LastRow To 7 Step -1
If IsEmpty(Range("C" & r).Value) Then
Rows(r).Hidden = True
End If
Next r
End Sub