Private Sub CommandButton1_Valider_Click()
Dim Arrivee As String, Sortie As String
Dim dArrivee As Date, dSortie As Date
Dim Tempo As Integer
Dim Duree As Long
Dim Lgn&
Lgn = ComboBox1.ListIndex + 1
If Lgn = 0 Then Exit Sub
With Tableau
.Cells(Lgn, 3) = ComboBox3
.Cells(Lgn, 4) = TextBox1
.Cells(Lgn, 5) = TextBox2
.Cells(Lgn, 6) = ComboBox6
.Cells(Lgn, 7) = ComboBox4
.Cells(Lgn, 8) = ComboBox5
.Cells(Lgn, 9) = TextBox3
.Cells(Lgn, 10) = TextBox4
.Cells(Lgn, 11) = TextBox6
.Cells(Lgn, 25) = TextBox5
.Cells(Lgn, 12) = ComboBox7
.Cells(Lgn, 13) = TextBox7
Arrivee = .Cells(Lgn, 10)
Tempo = InStr(1, Arrivee, ".")
Arrivee = Right(Arrivee, Len(Arrivee) - Tempo - 1)
dArrivee = DateValue(Arrivee)
Sortie = .Cells(Lgn, 13)
Tempo = InStr(1, Sortie, ".")
Sortie = Right(Sortie, Len(Sortie) - Tempo - 1)
dSortie = DateValue(Sortie)
Duree = dSortie - dArrivee
.Cells(Lgn, 15) = "Durée de traitement " & Duree & " jour(s)"
.Cells(Lgn, 17) = ComboBox8
.Cells(Lgn, 14) = TextBox9
End With
Sheets("Accueil").Select
Range("T10").Select
Unload Me
End Sub