View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Dean[_9_] Dean[_9_] is offline
external usenet poster
 
Posts: 24
Default Very Slow Macro Problem

Hi, I have this macro which essentially hides all rows with a value of
"0" however it takes way too long to get through its task. I think it
maybe due to hiding each row one at a time and not all at once??

Would appreciate any advice or changes to make it all happen for me
more quickly.

Regards,
Dean


Sub Macro4()
Application.ScreenUpdating = False
Set rng = Range("1:991").Rows
For i = 1 To rng.Rows.Count
If IsNumeric(rng(i).Cells(2).Value) Then
If rng(i).Cells(2).Value = 0 Then rng(i).EntireRow.Hidden =
True
End If
Next
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Rows("1:991").Select
Selection.EntireRow.Hidden = False
Range("L3").Select
Application.ScreenUpdating = True
Application.Run Macro:="Macro6"
End Sub