ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Formatting times (https://www.excelbanter.com/excel-programming/295528-formatting-times.html)

SmilingPolitely

Formatting times
 
I am trying to write a function to display the time elapsed since
StartTime and Now() and have it formatted as H:mm:ss

I tried this code:

Format(DateDiff("s", StartTime, Now()), "H:mm:ss")

but without result.

Can someone please help?


Bob Phillips[_6_]

Formatting times
 
Try this

Debug.Print Format(Now() - starttime, "H:mm:ss")

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"SmilingPolitely" wrote in message
. au...
I am trying to write a function to display the time elapsed since
StartTime and Now() and have it formatted as H:mm:ss

I tried this code:

Format(DateDiff("s", StartTime, Now()), "H:mm:ss")

but without result.

Can someone please help?





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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com