View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default How to clock a procedure

Try something like the following code:

Dim StartTime As Double
Dim EndTime As Double
StartTime = Now
'
' your code here
'
EndTime = Now
MsgBox "Procedure took: " & Format(EndTime - StartTime,
"hh:mm:ss")


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com






"42N83W" wrote in message
...
What methods are available with VBA fro clocking procedures? I
have a subroutine that could run anywhere from 30 seconds to
over 5 minutes. I'd like to be able to display the total
elapsed time for the procedure to run in a message box (for my
own edification of course, no real "need" for the information).

Thanks!

-gk-

--
=================================================
The creative act is not the province of remote oracles or
rarefied geniuses
but a transparent process that is open to everyone.
-Greg Kot in Wilco Learning How To Die-