Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
convert a number of seconds to HH:MM:SS?
I use timer in my code.
It calculates the time elapsed by subtracting a number of seconds fro another number of seconds e.g. 50256.3470 - 40155.1 The value returned, should be in the format HH:MM:SS. How is this done in code? I dont want to write any functions into ranges on the sheet or forma any cells... Thanks!! -- Message posted from http://www.ExcelForum.com |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
convert a number of seconds to HH:MM:SS?
Divide the formula by 86400 and format the cell as hh:mm:ss.
86400=24 hrs*60min*60seconds. Excel stores time as the decimal fraction of one day. i.e. 12:00:00=0.5, 18:00:00=0.75, etc. Steff_DK < wrote: I use timer in my code. It calculates the time elapsed by subtracting a number of seconds from another number of seconds e.g. 50256.3470 - 40155.1 The value returned, should be in the format HH:MM:SS. How is this done in code? I dont want to write any functions into ranges on the sheet or format any cells... Thanks!!! --- Message posted from http://www.ExcelForum.com/ |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
convert a number of seconds to HH:MM:SS?
OK, no format:
range("A1").value=format(yourFormula/86400,"hh:mm:ss") JWolf wrote: Divide the formula by 86400 and format the cell as hh:mm:ss. 86400=24 hrs*60min*60seconds. Excel stores time as the decimal fraction of one day. i.e. 12:00:00=0.5, 18:00:00=0.75, etc. Steff_DK < wrote: I use timer in my code. It calculates the time elapsed by subtracting a number of seconds from another number of seconds e.g. 50256.3470 - 40155.1 The value returned, should be in the format HH:MM:SS. How is this done in code? I dont want to write any functions into ranges on the sheet or format any cells... Thanks!!! --- Message posted from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to convert number in to time lenght, minutes and seconds? | Excel Discussion (Misc queries) | |||
Convert time in number of seconds | Excel Worksheet Functions | |||
Convert "Time Interval" in "hours : minutes : seconds" to seconds | New Users to Excel | |||
How do i convert a number of seconds to a date/time? | Excel Worksheet Functions | |||
Convert seconds to minutes and seconds in excel | Excel Worksheet Functions |