Too much time for rows delete

P

Petro

Hello all,
I wrote a macro which have to delete some rows in a sheet.
The sheet contains many sum formulas. When I start the
macro, it work very well but after 10 deletes it needs
more time than before and after 20 deletes it needs over
30 seconds for one delete. When I break the macro and do
the delete manually, the same happen. When I do this
before starting the macro the time consumption for delete
was ok.

Maybe someone have a solution for the problem.

Locking forward
Petro
 
J

John Sanders

Petro,
I don't have an answer as to why it runs slow, but have you tried turning
the screen updates off? If not use:

Application.ScreenUpdating = False.

That will tell Excel to NOT refresh the screen so the Macro runs faster. In
some cases, signifigantly.

Don't forget to turn it back on when your macro is finished, and in any
error handling routines:

Application.ScreenUpdating = True.

Later,
John
 
P

Petro

Hey John,
thanks for your answer.

This statemants are coded before deleting
Application.EnableEvents = False
Application.ScreenUpdating = False
With Application
.Calculation = xlManual
End With
and all print settings I deleted manually before.

Regards
Petro
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top