Bonjour,
Une correction :
Private Sub ComboBox1_Change()
End Sub
Private Sub CommandButton1_Click()
If ComboBox1.Value = "" Then
MsgBox "Veuillez renseigner le champs 'NOM PRENOM'"
Else
Dim lligne As Integer
If MsgBox("Confirmez-vous l'ajout des données ?", vbYesNo, "Confirmation") = vbYes Then
Worksheets("Feuil1").Select
ligne = Sheets("Feuil1").Range("A456541").End(xlUp).Row + 1
Cells(ligne, 1) = TextBox1.Value
Cells(ligne, 2) = ComboBox1.Value
Cells(ligne, 4) = TextBox2.Value
Cells(ligne, 5) = TextBox3.Value
Cells(ligne, 6) = TextBox4.Value
Cells(ligne, 7) = TextBox5.Value
Unload UserForm1
UserForm1.Show
Else
End If
End If
End Sub
Private Sub CommandButton2_Click()
If Not ComboBox1.Value = "" Then
Dim no_ligne As Integer
no_ligne = ComboBox1.ListIndex + 2
TextBox1.Value = Cells(no_ligne, 1).Value
ComboBox1.Value = Cells(no_ligne, 2).Value
TextBox2.Value = Cells(no_ligne, 4).Value
TextBox3.Value = Cells(no_ligne, 5).Value
TextBox4.Value = Cells(no_ligne, 6).Value
TextBox5.Value = Cells(no_ligne, 7).Value
Else
End If
End Sub
Private Sub CommandButton3_Click()
Dim modif As Integer
If Not ComboBox1.Value = "" Then
Sheets("Feuil1").Select
modif = ComboBox1.ListIndex + 2
Cells(modif, 1) = TextBox1.Value
Cells(modif, 2) = ComboBox1.Value
Cells(modif, 3) = TextBox2.Value
Cells(modif, 4) = TextBox3.Value
Cells(modif, 5) = TextBox4.Value
Cells(modif, 6) = TextBox5.Value
MsgBox ("Modification effectuer")
Else
MsgBox ("Veuillez sélectionner le NOM PRENOM de la personne à modifier")
Exit Sub
End If
Unload UserForm1
UserForm1.Show 0
End Sub
Private Sub UserForm_Click()
End Sub