Timed Operation

  • Thread starter Thread starter Todd Huttenstine
  • Start date Start date
T

Todd Huttenstine

hey guys

I have a code that takes about 1 minute 40 seconds to
run. Is there anyway to time how long this operation
takes? At the very end of my code I want to put a message
box stating how long it took the code from start until the
point I want the message to appear.


Thanks

Todd Huttenstine
 
Todd,

Write your code similar to the following:

Dim StartTime As Double
Dim EndTime As Double
StartTime = Now
'
' your code here
'
EndTime = Now
Msgbox "Code took: " & Format(EndTime - StartTime,"hh:mm:ss") & "
to run"


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 
Dim strt as Single
strt = Timer

.. . .

msgbox "took " & Timer - strt & " seconds"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Reversing Words 5
LastName, FirstName format 2
Selecting a listbox item event 3
All open projects 4
Collection Object Keys 10
Listbox Selection 1
Listbox 8
Bold certain text in textbox 1

Back
Top