View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
DMoney DMoney is offline
external usenet poster
 
Posts: 130
Default DAY BETWEEN TWO DATES AND TIME

Try this out - edit the ranges to match your date locations - never tried
this before, but i think this will get the answer u need.

Dim tst As Variant
Dim tst1 As Variant
Dim tst3 As Variant

tst1 = DateDiff("d", Range("G12"), Range("H12"))
tst = DateDiff("h", Range("G12"), Range("H12")) / 24
tst = Left(tst, 4)
tst = Right(tst, 3)
If tst = 0.29 Then
tst3 = tst1 + 1
Else
tst3 = tst1
End If
MsgBox tst3

Devin

" wrote:

I would like to know how many days between two dates and time.
Exemple: 1 Dec 14:00 to 3 Dec 21:00, will be 2 days but I want to know
how many days it will when you go over 6 hours more than the 24 hours.
The exemple shown it will be 3 days.
You can reply via my email: