Bonjour j'ai eu l'erreur d'exécution 91 : Variable object ou variable de bloc with non definie
Quand je clique sur débogage il me cible :
Private Sub modification_Click()
Form_modif.Show
End Sub
et voice le code entire :
FEUIL1
Private Sub Ajouter_Click()
Form_ajout.Show
End Sub
Private Sub modification_Click()
Form_modif.Show
End Sub
Private Sub suppression_Click()
ID = InputBox("Veuillez écrire le numéro de l'ID à supprimer", "ID à supprimer")
ID2 = CInt(ID)
For i = 2 To WorksheetFunction.CountA(Range("A:A"))
If ID2 = Cells(i, 1) Then
Rows(i).Delete
End If
Next
End Sub
Form_Modif :
Private Sub annuler_Click()
Unload Form_modif
End Sub
Private Sub modifier_Click()
End Sub
Private Sub UserForm_Initialize()
Form_modif.fonction.AddItem ("TOOLEUR")
Form_modif.fonction.AddItem ("CONCEPTEUR")
Form_modif.fonction.AddItem ("STAGIERE")
ID = InputBox("Veuillez entrer l'id de la personne à modifer", "id de modification")
If ID <> "" Then
ID2 = CInt(ID) ' mettre en integer
For i = 2 To WorksheetFunction.CountA(Range("A:A"))
If Cells(i, 1) = ID2 Then
Form_modif.nom = Cells(i, 2)
Form_modif.prenom = Cells(i, 3)
Form_modif.fonction = Cells(i, 4)
End If
Next
End If
Unload Form_modif
End Sub
Le problème vient quand je rentre mon ID avec l'inputBox.
Je vous remercie pour votre futur aide ..
Cordialement.