Dim Time1 As String
Dim Time2 As String
Dim Hours As Long
Dim Minutes As Long
Time1 = "40644:30:00"
Time2 = "20:15:00"
Hours = CLng(Split(Time1, ":")(0)) + CLng(Split(Time2, ":")(0))
Minutes = CLng(Split(Time1, ":")(1)) + CLng(Split(Time2, ":")(1))
Hours = Hours + CLng(Minutes / 60 - 0.5)
Minutes = Minutes Mod 60
Debug.Print Hours & ":" & Minutes
this is nice but is have problem when i need subtract its not wrok
like 11:00-1:15= 9:-15 its wrong
but i use is
Dim dteTemp As Date
Dim Time1 As String
Dim Time2 As String
Time1 = "11:00"
Time2 = "1:15"
dteTemp = TimeValue(Val(Split(Time1, ":")(0)) - Val(Split(Time2, ":")(0)), Val(Split(Time1, ":")(1)) - Val(Split(Time2, ":")(1)), 0)
Debug.Print = DateDiff("D", CDate(0), dteTemp) * 24 + Hour(dteTemp) & ":" & Minute(dteTemp)
but its not work with long time (40644:30:00-1:15)
Dim Time2 As String
Dim Hours As Long
Dim Minutes As Long
Time1 = "40644:30:00"
Time2 = "20:15:00"
Hours = CLng(Split(Time1, ":")(0)) + CLng(Split(Time2, ":")(0))
Minutes = CLng(Split(Time1, ":")(1)) + CLng(Split(Time2, ":")(1))
Hours = Hours + CLng(Minutes / 60 - 0.5)
Minutes = Minutes Mod 60
Debug.Print Hours & ":" & Minutes
this is nice but is have problem when i need subtract its not wrok
like 11:00-1:15= 9:-15 its wrong
but i use is
Dim dteTemp As Date
Dim Time1 As String
Dim Time2 As String
Time1 = "11:00"
Time2 = "1:15"
dteTemp = TimeValue(Val(Split(Time1, ":")(0)) - Val(Split(Time2, ":")(0)), Val(Split(Time1, ":")(1)) - Val(Split(Time2, ":")(1)), 0)
Debug.Print = DateDiff("D", CDate(0), dteTemp) * 24 + Hour(dteTemp) & ":" & Minute(dteTemp)
but its not work with long time (40644:30:00-1:15)