Hi hwtcrl,
Welcome to the joys of Excel time formatting. See the attached updated workbook. I changed the following:
a. I changed your cells in Column 'A' to text format by putting an apostrophe in front of each value. Although Excel displays the values as text, it really stores the values as a real number 0 <= x < = 1 as a fraction of a day. e.g. 0.25 is 6AM.
b. I changed the UserForm code to add the times and then convert them to display in PrettyPrint format:
Label3.Caption = Format(CDate(TN + T1), "hh:mm:ss")
Complete UserForm code follows:
Private Sub ComboBox1_Change()
Dim TN As Date, T1 As Date, TS As Date
T1 = CDate(ComboBox1.Value)
TN = CDate(Label2.Caption)
Label3.Caption = Format(CDate(TN + T1), "hh:mm:ss")
End Sub
Private Sub ComboBox2_Change()
Dim TN As Date, T1 As Date, TS As Date
T1 = CDate(ComboBox2.Value)
TN = CDate(Label2.Caption)
Label4.Caption = Format(CDate(TN + T1), "hh:mm:ss")
End Sub
Private Sub ComboBox3_Change()
Dim TN As Date, T1 As Date, TS As Date
T1 = CDate(ComboBox3.Value)
TN = CDate(Label2.Caption)
Label5.Caption = Format(CDate(TN + T1), "hh:mm:ss")
End Sub
Private Sub CommandButton1_Click()
Label2.Caption = Format(Now(), "hh:mm:ss")
End Sub
Lewis
Bookmarks