Why would macro slows down after each iteration and also why would it improves when I start another application? Performance related question

korhan

Board Regular
Joined
Nov 6, 2009
Messages
215
Hello all,
I have noticed a very interesting behavior when I was measure the timing on my macro?

I have used a pretty common method. Set the timer in the beginning of each iteration and then display how long each iteration takes.
In the beginning it was taking around 8 seconds for each loop and then started to increase to 11, 12, 15, 16, 17 ... so on but then when I started another application somehow time went back to 8 seconds. I have tested the same thing over and over again. Somehow, opening up another application resets this behavior. Anybody has noticed anything similar?
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
That really depends on what your macro is doing. Macros that repeatedly write to a worksheet, especially to the same area, tend to slow down as they ever more data to Excel's undo buffer.
 
Upvote 0

Forum statistics

Threads
1,216,236
Messages
6,129,652
Members
449,526
Latest member
hmoh

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top