Hi,

I am trying to get the difference if time and I am having problem, here is my code, any help is appretiated. Thanks in advance!

Dim MyTime As Date
Dim MyMinute As Date
Dim m As Date
Dim m2 As Date
Dim h As Date

MyTime = #6:35:17 PM# ' Assign a time.
m = #5:30:17 PM# ' Assign a time.
MyMinute = Minute(MyTime) ' MyMinute contains 35.
If MyTime > m Then
h = Hour(MyTime) - Hour(m)
If h >= 0 Then
m2 = Minute(MyTime) - Minute(m)
h = m2 + h
MsgBox h
End If
End If