View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Norman Jones Norman Jones is offline
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?