Private Sub ComboBox1_Change()
If ComboBox1 <> "" & TextBox1 <> "" Then calcul
End Sub
Private Sub CommandButton1_Click()
Application.DisplayAlerts = False
Application.Quit
End Sub
Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
If ComboBox1 <> "" & TextBox1 <> "" Then calcul
End Sub
Private Sub UserForm_Initialize()
For Each cel In Sheets("CREW").Range("B13:B50")
If cel <> "" Then ComboBox1.AddItem cel.Value
Next
End Sub
Sub calcul()
If ComboBox1.ListIndex <> -1 Then
TextBox3 = Format(Sheets("CREW").Cells(ComboBox1.ListIndex + 13, 4), "hh:mm")
TextBox1 = Format(TextBox1, "hh:mm")
TextBox2 = Format(Sheets("CREW").Range("D7"), "hh:mm")
x = TimeValue(TextBox1) + TimeValue(TextBox2) + TimeValue(TextBox3)
TextBox4 = Format(x, "hh:mm")
y = Format(Sheets("CREW").Range("D8"), "hh:mm")
TextBox5 = Format(TimeValue(TextBox1) + TimeValue(y), "hh:mm")
TextBox6 = Format(Sheets("CREW").Range("D8"), "hh:mm")
End If
End Sub