Deleting rows using VBA
Hey Lonnie, that worked! Thanks a big heap! I knew
there was some reason for the slowdown, and I didn't want
to complicate things even further. The great thing about
these forums is that you can get different opinions on
issues.
Again, thanks!
Merlin
-----Original Message-----
Merlin, I have experienced the same problem. It seems
that now Excel
tries to calculate vlookup and index/match functions
after deleting
each individual row or something. What I did was:
Application.Calculation = xlCalculationManual and then
turn back
Application.Calculation = xlCalculationAutomatic.
In fact I have now created an add-in with the following
code:
Sub Auto_Open()
Application.OnKey "+^{DELETE}", "DELETEmyRows"
End Sub
Sub DELETEmyRows()
' Keyboard Shortcut: Ctrl+Shift+DELETE
Application.DisplayAlerts = False
Application.Calculation = xlCalculationManual
On Error Resume Next
Selection.EntireRow.Delete
Application.Calculation = xlCalculationAutomatic
Application.DisplayAlerts = True
End Sub
This gives me a keyboard shortcut to delete rows, it
works so much
faster!
Good Luck! Lonnie M.
.
|