snowboy001
Board Regular
- Joined
- Dec 5, 2009
- Messages
- 100
Forum,
This piece of code seems to run extremely slow. Does anyone have any ideas on how this could be optimized to run faster? I need it to run each time the sheet is activated, and eventually there will be several thousand lines in the sheet with data in them.
Thanks!
This piece of code seems to run extremely slow. Does anyone have any ideas on how this could be optimized to run faster? I need it to run each time the sheet is activated, and eventually there will be several thousand lines in the sheet with data in them.
Code:
Private Sub Worksheet_Activate()
'Unhides all rows then hides empty rows so that only active Action Items can be seen
Application.ScreenUpdating = False
Dim i, LastRow
Dim ActionList As Worksheet
Set ActionList = Worksheets("Action Item List")
Rows.Hidden = False
LastRow = ActionList.Range("A" & Rows.Count).End(xlUp).Row
For i = LastRow To 1 Step -1
If Cells(i, "C") = "" Then
Cells(i, "C").EntireRow.Hidden = True
End If
Next i
Application.ScreenUpdating = True
End Sub
Thanks!