PDA

View Full Version : [SOLVED] Make macro timer a little bit more fancy



ashleyuk1984
10-14-2014, 06:50 AM
I've retrieved a small piece of code from a different website.
It basically calculates how long your macro takes to run.


Dim time1 As Double, time2 As Double
time1 = Timer
' <your macro here>
time2 = Timer
MsgBox Format(time2 - time1, "0.00 \s\ec")

The problem is, this only shows seconds. So, instead of showing "1 min 20 secs", it will show "80 secs".
Of course, it's not a huge problem. It would be nice to show (maybe hours) minutes and seconds though.

I need to show how much time saving I've created. So instead of watching the clock lol, I've decided to use this instead.

Thank You.

mancubus
10-14-2014, 07:16 AM
one way is:



Dim time1 As Date

time1 = Now

MsgBox Format(Now - time1, "hh:mm:ss")

ashleyuk1984
10-14-2014, 07:37 AM
Ahh, that's perfect. I've managed to get exactly what I wanted with modifying that slightly.
Thanks

I can't find the solved button??

mancubus
10-14-2014, 07:51 AM
welcome.

did you try thread tools?

ashleyuk1984
10-14-2014, 08:22 AM
Got it. Cheers