View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips Bob Phillips is offline
external usenet poster
 
Posts: 10,593
Default Evaluate time spent on macro running

Sub RunTimer()
Dim nTime As Double
Dim i As Long, j As Long

nTime = Timer
For i = 1 To 1000000
For j = 1 To 100
Next j
Next i

MsgBox Format((Timer - nTime), "0.0 ""seconds""")
End Sub

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Morris" wrote in message
ups.com...
I was thinking of retrieving the time at the beginning of the macro, eg
in 10:31:02 converted to seconds (=37802 or sth) and then the time of
"seconds" at the end. Then subtract it and voila - convert it to
minutes and seconds (the macro runs for about 2-5 mins.

Is there any quick way to do that? Or is there a smarter way?

Cheers