Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 260
Default Timed Operation

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Timed Operation

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




"Todd Huttenstine" wrote in
message ...
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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Timed Operation

Dim strt as Single
strt = Timer

.. . .

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

--
Regards,
Tom Ogilvy

"Todd Huttenstine" wrote in message
...
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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Timed macros LiAD Excel Worksheet Functions 5 April 1st 09 09:24 AM
timed events H1 Excel Worksheet Functions 2 September 11th 08 01:54 PM
TIMED MSGBOX FARAZ QURESHI Excel Discussion (Misc queries) 6 January 3rd 07 08:24 PM
timed macro Decreenisi Excel Worksheet Functions 3 March 3rd 06 12:33 PM
timed macro alan_bourne[_21_] Excel Programming 3 November 26th 03 11:44 AM


All times are GMT +1. The time now is 04:04 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"