Private Sub CommandButton1_Click()
Dim ligne As Integer
horaire_debut_matin = Split(TextBox1.Value, "h")
horaire_fin_matin = Split(TextBox2.Value, "h")
duree_matin = (horaire_fin_matin(0) * 60 + horaire_fin_matin(1)) - (horaire_debut_matin(0) * 60 + horaire_debut_matin(1))
MsgBox "Durée du matin : " & duree_matin & " (minutes"
ligne = ActiveCell.Row
Range("A2").Select
'If Len(Sheets("Feuil2").Cells(ligne, 2))= Then
If Range("A2").Value = "" Then
ligne = Range("Feuil2!A65500").End(xlUp).Row + 1
Else
ligne = Range("Feuil2!A65500").End(xlUp).Row + 1
End If
Sheets("Feuil2").Cells(ligne, 1) = ligne
'End If
Sheets("Feuil2").Cells(ligne, 1) = TextBox1.Value
Sheets("Feuil2").Cells(ligne, 2) = TextBox2.Value
Sheets("Feuil2").Cells(ligne, 3) = TextBox3.Value
Sheets("Feuil2").Cells(ligne, 4) = TextBox4.Value
Sheets("Feuil2").Cells(ligne, 5) = TextBox5.Value
Unload Me
End Sub