1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
| Private Sub CommandButton1_Click()
Dim i As Integer
If UserForm1.TextBox1 = "" Or UserForm1.TextBox2 = "" Then
MsgBox "MERCI DE SIASIR Les Champs Nom et Prénom", vbCritical, "Champs manquants"
TextBox1.SetFocus
Else
i = 1
Do While Cells(i, 1) <> ""
Cells(i, 1).Offset(1, 1).Select
i = i + 1
Loop
ActiveCell.Value = UCase(UserForm1.TextBox1.Value)
ActiveCell.Offset(0, 1).Value = UCase(Left(UserForm1.TextBox2.Value, 1)) & LCase(Right(UserForm1.TextBox2.Value, Len(UserForm1.TextBox2.Value) - 1))
ActiveCell.Offset(0, 2).Value = UserForm1.TextBox3.Value
ActiveCell.Offset(0, 4).Value = UserForm1.ComboBox1.Value
UserForm1.TextBox1.Value = ""
UserForm1.TextBox2.Value = ""
UserForm1.TextBox3.Value = ""
UserForm1.ComboBox1.Value = ""
TextBox1.SetFocus
End If
If ActiveCell.Offset(-1, -1).Value = "ID" Then
ActiveCell.Offset(0, -1).Value = 1
Else
ActiveCell.Offset(0, -1).Value = ActiveCell.Offset(-1, -1).Value + 1
End If
End Sub |
Partager