Hi, I have 4 different text boxes each contain a different time (8:00, 12:43, 22:12, 9:56) and I want to add up the total time in hours and minutes.
without On Error Resume Next I get an error: type mismatch on lines:Code:Private Sub Command6_Click() On Error Resume Next If Len(Trim(lanaweek1.Text)) <> 0 And _ Len(Trim(katieweek1.Text)) <> 0 And _ Len(Trim(christinaweek1.Text)) <> 0 And _ Len(Trim(fillweek1.Text)) <> 0 Then timetoadd = TimeValue(lanaweek1.Text) _ + TimeValue(katieweek1.Text) _ + TimeValue(christinaweek1.Text) _ + TimeValue(fillweek1.Text) storeweek1 = Format(timetoadd, "hh:mm") End If End Sub
Thank you in advance for any suggestions.Code:timetoadd = TimeValue(lanaweek1.Text) _ + TimeValue(katieweek1.Text) _ + TimeValue(christinaweek1.Text) _ + TimeValue(fillweek1.Text)




Reply With Quote