#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 394
Default Time Sub

Hi everyone,

How can I get the total processing time of a Sub to appear in a
message box once the Sub has finished please.
I have got ...

Dim start As Double
Start = Timer

.... so far but want it to produce the processing time in the format x
hours y minutes & z seconds.
I know it will be something like Timer - Start but then I am at a
loss.
Perhaps something like ...

"Processing Time " & Format(Timer - Start) / 24 / 60 / 60) = x hours y
minutes & z seconds)

Thanks in Advance.
All the Best.
Paul

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Time Sub

MsgBox "Processing time " & Format((Timer - Start) / 24 / 60 / 60,
"hh:mm:ss")


--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Paul Black" wrote in message
ps.com...
Hi everyone,

How can I get the total processing time of a Sub to appear in a
message box once the Sub has finished please.
I have got ...

Dim start As Double
Start = Timer

... so far but want it to produce the processing time in the format x
hours y minutes & z seconds.
I know it will be something like Timer - Start but then I am at a
loss.
Perhaps something like ...

"Processing Time " & Format(Timer - Start) / 24 / 60 / 60) = x hours y
minutes & z seconds)

Thanks in Advance.
All the Best.
Paul



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 394
Default Time Sub

Thanks Bob, I appreciate the help.

All the Best.
Paul

On Aug 13, 1:42 pm, "Bob Phillips" wrote:
MsgBox "Processing time " & Format((Timer - Start) / 24 / 60 / 60,
"hh:mm:ss")

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Paul Black" wrote in message

ps.com...



Hi everyone,


How can I get the total processing time of a Sub to appear in a
message box once the Sub has finished please.
I have got ...


Dim start As Double
Start = Timer


... so far but want it to produce the processing time in the format x
hours y minutes & z seconds.
I know it will be something like Timer - Start but then I am at a
loss.
Perhaps something like ...


"Processing Time " & Format(Timer - Start) / 24 / 60 / 60) = x hours y
minutes & z seconds)


Thanks in Advance.
All the Best.
Paul- Hide quoted text -


- Show quoted text -



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Time Sub


Sub mytime()

Start = Now - 5
Timeelapse = (Timer - Start) / 24 / 60 / 60

timestring = "Processing Time " & Format(Timeelapse, "hh") & " hours " & _
Format(Timeelapse, "mm") & " minutes " & Format(Timeelapse, "ss") & _
" seconds"

End Sub
"Paul Black" wrote:

Hi everyone,

How can I get the total processing time of a Sub to appear in a
message box once the Sub has finished please.
I have got ...

Dim start As Double
Start = Timer

.... so far but want it to produce the processing time in the format x
hours y minutes & z seconds.
I know it will be something like Timer - Start but then I am at a
loss.
Perhaps something like ...

"Processing Time " & Format(Timer - Start) / 24 / 60 / 60) = x hours y
minutes & z seconds)

Thanks in Advance.
All the Best.
Paul


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 394
Default Time Sub

Thanks Joel,

One final point please. Is there any way to only get the actual time
elapsed please. What I mean by that is if the Sub only takes 9 minutes
& 24 seconds to run, then the time will only show the minutes and the
seconds and exclude the hours part. This also applies if it only took
seconds to run.

Thanks in Advance.
All the Best.
Paul

On Aug 13, 1:48 pm, Joel wrote:
Sub mytime()

Start = Now - 5
Timeelapse = (Timer - Start) / 24 / 60 / 60

timestring = "Processing Time " & Format(Timeelapse, "hh") & " hours " & _
Format(Timeelapse, "mm") & " minutes " & Format(Timeelapse, "ss") & _
" seconds"

End Sub



"Paul Black" wrote:
Hi everyone,


How can I get the total processing time of a Sub to appear in a
message box once the Sub has finished please.
I have got ...


Dim start As Double
Start = Timer


.... so far but want it to produce the processing time in the format x
hours y minutes & z seconds.
I know it will be something like Timer - Start but then I am at a
loss.
Perhaps something like ...


"Processing Time " & Format(Timer - Start) / 24 / 60 / 60) = x hours y
minutes & z seconds)


Thanks in Advance.
All the Best.
Paul- Hide quoted text -


- Show quoted text -





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 394
Default Time Sub

Hi,

I have hunted high and low to try and find something that accomodates
this on this Forum but to no avail.
I assume that nobody has either never asked for this before or it is a
limitation of Excel.

Thanks in Advance.
All the Best.
Paul

On Aug 13, 1:59 pm, Paul Black wrote:
Thanks Joel,

One final point please. Is there any way to only get the actual time
elapsed please. What I mean by that is if the Sub only takes 9 minutes
& 24 seconds to run, then the time will only show the minutes and the
seconds and exclude the hours part. This also applies if it only took
seconds to run.

Thanks in Advance.
All the Best.
Paul

On Aug 13, 1:48 pm, Joel wrote:



Sub mytime()


Start = Now - 5
Timeelapse = (Timer - Start) / 24 / 60 / 60


timestring = "Processing Time " & Format(Timeelapse, "hh") & " hours " & _
Format(Timeelapse, "mm") & " minutes " & Format(Timeelapse, "ss") & _
" seconds"


End Sub


"Paul Black" wrote:
Hi everyone,


How can I get the total processing time of a Sub to appear in a
message box once the Sub has finished please.
I have got ...


Dim start As Double
Start = Timer


.... so far but want it to produce the processing time in the format x
hours y minutes & z seconds.
I know it will be something like Timer - Start but then I am at a
loss.
Perhaps something like ...


"Processing Time " & Format(Timer - Start) / 24 / 60 / 60) = x hours y
minutes & z seconds)


Thanks in Advance.
All the Best.
Paul- Hide quoted text -


- Show quoted text -- Hide quoted text -


- Show quoted text -



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
Time calculations for Scheduled Time vs. Actual Time Worked The Caterer Excel Discussion (Misc queries) 1 November 29th 09 08:08 AM
straight time, time and a half, and double time Jeremy Excel Discussion (Misc queries) 3 September 23rd 08 09:03 PM
Calculate Ending time using Start Time and Elapsed Time Chief 711 Excel Worksheet Functions 5 May 13th 08 04:34 PM
verify use of TIME Function, Find Quantity Level compare to time-d nastech Excel Discussion (Misc queries) 9 July 11th 07 01:58 PM
Calculating days & time left from start date/time to end date/time marie Excel Worksheet Functions 7 December 7th 05 02:36 PM


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

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

About Us

"It's about Microsoft Excel"