Macro That Deletes Rows Extremely Slow
Could be several things, but you need to add this to the code.
Sub DynamicGet(intField As Integer, strCriterion As String)
Application.ScreenUpdating = False
application.Calculation=xlCalculationManual
Columns("AA:AD").Select
Selection.AutoFilter Field:=intField, Criteria1:=strCriterion
Range("A2:BD30000").Select
**********Selection.EntireRow.Delete************
Selection.AutoFilter Field:=intField
Range("A2").Select
Application.Calculation =xlCalculationAutomatic
Application.ScreenUpdating = True
End Sub
--
-John
Please rate when your question is answered to help us and others know what
is helpful.
"LarryP" wrote:
I have an Excel macro that runs fine on many people's computers, but on one
person's machine the delete line (set off with asterisks below) takes
forever; when she gets to it, everything in the Task Manager related to
Microsoft Office (not just Excel) shows the ol' "Not Responding" message.
She has waited as long as 45 minutes before giving up on a process that takes
only a few seconds on other machines. Any ideas?
Sub DynamicGet(intField As Integer, strCriterion As String)
Columns("AA:AD").Select
Selection.AutoFilter Field:=intField, Criteria1:=strCriterion
Range("A2:BD30000").Select
**********Selection.EntireRow.Delete************
Selection.AutoFilter Field:=intField
Range("A2").Select
End Sub
|