1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| Private Sub CommandButton1_Click()
Dim LI As Long 'Remplissage de la feuille avec l'userform
Dim TB1 As Variant
LI = Range("B65536").End(xlUp).Row + 1
If Enregistrement_panne.TextBox2.Value <> "" And Len(Enregistrement_panne.TextBox2.Text) < 10 Or (Enregistrement_panne.TextBox2.Value <> "" And Not IsDate(Enregistrement_panne.TextBox2.Value)) Then
TB1 = MsgBox("La date doit etre au format" & Chr(10) & " " & Chr(10) & "jj/mm/aaaa", vbOKOnly, "ATTENTION")
If TB1 = vbOK Then
Enregistrement_panne.Hide
Enregistrement_panne.TextBox2 = ""
Enregistrement_panne.TextBox2.SetFocus
Enregistrement_panne.Show
End If
End If
Cells(LI, 2).Value = TextBox8.Value
Cells(LI, 3).Value = TextBox2.Value
Cells(LI, 4).Value = ComboBox1.Value
Cells(LI, 5).Value = TextBox3.Value
Cells(LI, 6).Value = TextBox4.Value
Cells(LI, 7).Value = TextBox5.Value
Cells(LI, 8).Value = TextBox6.Value
Cells(LI, 9).Value = TextBox7.Value
End Sub |
Partager