Speed Is What I Need
Posted by Jon Griggs on August 07, 2001 6:51 AM
I have some macro code that works, but is excruciatingly slow. I have disabled screen updates and changed the calculation mode to manual. (Yes, the first person to actually try to use the archives ;-} ).
The code is as follows.
Sub DelRows()
'
' Macro recorded 8/7/01 by jgriggs
'
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
For x = Range("N1").End(xlDown).Row To 1 Step -1
If Cells(x, 13) = True Then
Rows(x).Delete Shift:=xlUp
End If
Next x
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
End Sub
This is the pertinent subset.
The only thing I left out is a whole set of ORs and ANDs to make the decisions this subset is operating from.
The code execution went from an (extrapolated) 20 hours down to 4 hours with the addition of the first two lines (running on 20000 lines).
I would appreciate any help to get this lower.
Thanks
Jon Griggs