Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

2007 VBA Duration format

Status
Not open for further replies.

gulsbyd

Programmer
Jan 13, 2010
2
US
I understand Time in VBA is a double. Whole number being days and fractions being hours/minutes/secs. Example 1.3 = 31 hours 12 minutes 00 seconds.

What I am trying to do is chart this as 31:12:00, but the best I've been able to do is send "31:12:00" to an Excel Chart which isn't chartable due to being a String type. I can chart the 1.3 but this isn't valuable to the average user. I can format the vertical axis to represent the time, but the hover over points show 1.3 instead of 31:12:00.

Any and all suggestions would be greatly appreciated.

Thanks in advance,
gulsbyd
 
Did you set the NumberFormat property of the cell to [h]:mm:ss;@ ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
At this time, I'm not returning the number to a cell, but directly to a chart. I've a two dimensional array(1 to ?, 1 to 1) I send to the Excel Chart to populate the data. I may need to in order to correctly represent the hover over points.

gulsbyd
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top