R
RITCHI
Hi
I have quite a long procedure that conditionally formats a worksheet.
It calls a number of other procedures including the one below to delete
rows.
It works well for i=50 but beyond 500 is very slow. I need to check
over 3000rows
Any advice on how to speed things up would be appreciated.
Sub DeleteRows()
'deletes rows where number of characters in cells in column 1 is 0,
from bottom upwards
Dim i As Integer
Application.ScreenUpdating = False
With ActiveSheet
For i = 500 To 6 Step -1
If Len(Cells(i, 1)) = 0 Then
With Cells(i, 1).EntireRow
.Delete Shift:=xlUp
End With
End If
Next
End With
Application.ScreenUpdating = True
End Sub
Ritchi
I have quite a long procedure that conditionally formats a worksheet.
It calls a number of other procedures including the one below to delete
rows.
It works well for i=50 but beyond 500 is very slow. I need to check
over 3000rows
Any advice on how to speed things up would be appreciated.
Sub DeleteRows()
'deletes rows where number of characters in cells in column 1 is 0,
from bottom upwards
Dim i As Integer
Application.ScreenUpdating = False
With ActiveSheet
For i = 500 To 6 Step -1
If Len(Cells(i, 1)) = 0 Then
With Cells(i, 1).EntireRow
.Delete Shift:=xlUp
End With
End If
Next
End With
Application.ScreenUpdating = True
End Sub
Ritchi