KirnonBhale
New Member
- Joined
- Jul 25, 2019
- Messages
- 11
Code:
[FONT=Calibri][SIZE=3][COLOR=#000000]Sub HideRowsOnSheet()[/COLOR][/SIZE][/FONT]
[FONT=Calibri][SIZE=3][COLOR=#000000]Dim i As Long[/COLOR][/SIZE][/FONT]
[FONT=Calibri][SIZE=3][COLOR=#000000]Application.ScreenUpdating = False[/COLOR][/SIZE][/FONT]
[FONT=Calibri][SIZE=3][COLOR=#000000]For i = 10 To 122[/COLOR][/SIZE][/FONT]
[FONT=Calibri][SIZE=3][COLOR=#000000] IfActiveSheet.Cells(i, "D") = 0 And ActiveSheet.Cells(i, "D")<> "" Then ActiveSheet.Rows(i).Hidden = True[/COLOR][/SIZE][/FONT]
[FONT=Calibri][SIZE=3][COLOR=#000000]Next i[/COLOR][/SIZE][/FONT]
[FONT=Calibri][SIZE=3][COLOR=#000000]Application.ScreenUpdating = True[/COLOR][/SIZE][/FONT]
[FONT=Calibri][SIZE=3][COLOR=#000000]End Sub[/COLOR][/SIZE][/FONT]
The above code does the job but it takes over 2min. to finish running. This seems especially slow as I could accomplish the task that the code is performing more quickly. Is there a quicker way to accomplish the task of hiding rows with a 0 in column D?
I have a similar code for operation over 8 Tabs but it takes 20 min + to fully run which is in my mind excessive.
Any help making this run quicker would be greatly appreciated.