Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
didn't do too much testing, but see if this works for you:
dim startTime as date dim endTime as date dim tTime as date starttime = Now() ' your code endTime = Now() tTime = (endTime - startTime) * 86400 Debug.Print WorksheetFunction.Floor(tTime / 60, 1) & " minutes " & tTime Mod 60 & " seconds" or you can use a msgbox instead of the debug.print statement msgbox WorksheetFunction.Floor(tTime / 60, 1) & " minutes " & tTime Mod 60 & " seconds" -- Gary Keramidas Excel 2003 "gotroots" wrote in message ... Hi folks Thanks for all the advice. I went for Mike H. approach as it will deal with the midnight issue. My test returned 1786.469 It would be helpful if the result can be in the hh:mm:ss format. Thank you "Mike H" wrote: it would help if I read my code before posting it:( Try this instead Start = Timer 'Your code MsgBox Timer - Start Mike "Mike H" wrote: Hi, Timer is the number of seconds since midnight so this will fail if the code runs over midnight Dim runtime As Long Start = Timer 'Your code MsgBox = Timer - Start Mike "gotroots" wrote: Hi Is there a msgbox method that will record the length of time it take for code to complete its execution. Thank you. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Record time by formula | Excel Worksheet Functions | |||
How do you print 1 record at a time per page? | Excel Discussion (Misc queries) | |||
Daily Time Record | Excel Programming | |||
Retrieve and update 1 record at a time | Excel Programming | |||
A stopwatch to record time in a cell | Excel Programming |