Link to home
Get AccessLog in
Avatar of Michael
Michael

asked on

Excel VBA extracting hours, minutes and seconds from a Duration time stamp

I wish to extract the hours, minutes and seconds from a duration time stamp for example: 114:35:10

If such a duration is inserted into a cell, excel places a date stamp prior to it.

When I attempt to use:

Hour(string) or format(string,  “[h]:mm:ss”) the result is incorrect.
I also want to be able to extract the mm and ss values.

Can an expert please help.
ASKER CERTIFIED SOLUTION
Avatar of Subodh Tiwari (Neeraj)
Subodh Tiwari (Neeraj)
Flag of India image

Link to home
membership
This content is only available to members.
To access this content, you must be a member of Experts Exchange.
Get Access
SOLUTION
Link to home
membership
This content is only available to members.
To access this content, you must be a member of Experts Exchange.
Get Access
@Michael

How is the duration cell formatted?
SOLUTION
Link to home
membership
This content is only available to members.
To access this content, you must be a member of Experts Exchange.
Get Access
Avatar of Michael
Michael

ASKER

Thanks for everyone responses. You have assisted me in either answering my question through the use of VBA or cell formulas. As for Aikimark comment: as soon as I input a duration the cell is formatted as “[h]:mm:ss”. Thanks for everyone’s input.
You're welcome Michael!
What is the unit(s) of your time duration that you enter?