convert a number of seconds to HH:MM:SS?

S

Steff_DK

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!!
 
J

JWolf

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top