Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 147
Default Convert two times to "Hours Worked"

Is there an easy way to convert 8:35 AM to 4:30 PM into the total number of
hours worked? Without changing it into 8:35 and 16:30 and then splitting the
numbers apart and doing the math?


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Convert two times to "Hours Worked"

Hi HotRod,

Apologies -momentary abberation!

Should have been:

Sub Test10()

Dim TotalHours As Double
Dim start As Double, finish As Double
finish = #4:30:00 PM#
start = #9:30:00 AM#

TotalHours = (finish - start) * 24
MsgBox TotalHours
End Sub

---
Regards,
Norman


"Norman Jones" wrote in message
...
Hi HotRod,

Sub Test10()

Dim TotalHours As Double
Dim start As Double, finish As Double
finish = TimeValue("4:30PM")
start = TimeValue("9:30")

TotalHours = (finish - start) * 24
MsgBox TotalHours
End Sub


"HotRod" wrote in message
...
Is there an easy way to convert 8:35 AM to 4:30 PM into the total number

of
hours worked? Without changing it into 8:35 and 16:30 and then splitting

the
numbers apart and doing the math?






  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 147
Default Convert two times to "Hours Worked"

Ended up doing it the hard way by splitting it and then putting it back
together but I'll give this a try as well. THANKS


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Convert two times to "Hours Worked"

Hi HotRod,

Sub Test10()

Dim TotalHours As Double
Dim start As Double, finish As Double
finish = TimeValue("4:30PM")
start = TimeValue("9:30")

TotalHours = (finish - start) * 24
MsgBox TotalHours
End Sub


"HotRod" wrote in message
...
Is there an easy way to convert 8:35 AM to 4:30 PM into the total number

of
hours worked? Without changing it into 8:35 and 16:30 and then splitting

the
numbers apart and doing the math?




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Trying to calculate hours worked on timecard using "IF" command Melissa Excel Worksheet Functions 6 January 5th 09 08:23 PM
any formula to convert numbers in word form, e.g. "2" as "Two"? Neeraj Excel Worksheet Functions 1 May 26th 08 01:03 PM
how i convert "100" to "hundred"( number to text) in excel-2007 mohanraj Excel Worksheet Functions 1 May 11th 08 09:07 PM
In Excell how can i get a total hours worked value from 2 times? Ronnie Kray Excel Worksheet Functions 11 September 9th 07 07:11 PM
convert "15000" to "Fifteen thousand" in excel cell? anurag Excel Worksheet Functions 1 May 4th 06 07:58 AM


All times are GMT +1. The time now is 10:38 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"