View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
JWolf JWolf is offline
external usenet poster
 
Posts: 136
Default 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/