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 John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding Times 2

Status
Not open for further replies.
Apr 27, 2006
126
GB
OK, this is likely a simple soloution but when I'm searching for what I need, I seem to be getting answers to much more complex problems (or at least I hope so).

Basically I have a sheet which contains lengths of times (rather than times of day) in hours.

so:

Code:
sheet5
__________
  A     B     C     D
1 05:00
2 07:00
3 03:00
4 08:00
5 08:00

So column A would total up to 31 Hours.

I have a label in a form which I wish to equal the sum of this column, so directly referenced, i get the decimal, if i format the label it shows as however many hours past midnight it has ran, i have tried

format(vTotaltime, "[h]:mm") and various variations but i get... well.. strange results..



Any ideas?

(thanks in advance)


________
clueless
 
Use a cell with NumberFormat="[h]:mm" and get its Text value.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 



or...
Code:
MsgBox Application.Text(Application.Sum(Selection), "[h]:mm")


Skip,

[glasses] [red][/red]
[tongue]
 
thanks, to both of you. It turns out that it's better for this instance me just multiplying by 24 and working with the decimal, but those are going to still be handy for further on in the app when I am going to have to be working with times more indepth.

click, click

________
clueless
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top