time how long a macro takes

shadow12345

Well-known Member
Joined
May 10, 2004
Messages
1,238
I would like to time how long a macro takes to complete and use debug print at certain points in the code so i can have a note of how long each section is taking.

any ideas?
 

Some videos you may like

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college

HalfAce

MrExcel MVP
Joined
Apr 6, 2003
Messages
9,453
Sure.
Try putting this line where you want to start timing:
A = Time
then your code and this where you want to stop
B = Time.

And show it however you like. (ie.) MsgBox ("Run time = " & A - B)

Hope it helps.
 

Blade Hunter

Well-known Member
Joined
Mar 13, 2008
Messages
3,147
Sure.
Try putting this line where you want to start timing:
A = Time
then your code and this where you want to stop
B = Time.

And show it however you like. (ie.) MsgBox ("Run time = " & A - B)

Hope it helps.
B - A not A - B

;)
 

shadow12345

Well-known Member
Joined
May 10, 2004
Messages
1,238
indeed.... see its not as hard as i thought then.

That should be enough

cheers.
 

HalfAce

MrExcel MVP
Joined
Apr 6, 2003
Messages
9,453
YES! YES!... Blade Hunter's right!
B - A not A - B

Good eye man.
Thanks for keeping me honest!
 

Subscribe on YouTube

Watch MrExcel Video

Forum statistics

Threads
1,105,950
Messages
5,508,324
Members
408,678
Latest member
ripperbolt

This Week's Hot Topics

Top