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 33 34 35 36
| Private Sub Cmb1_Click()
Dim BDP As Worksheet
Dim T As Range
Dim AdheSup As String
Set BDP = Worksheets("Adhé")
AdheSup = Cb1.Value
'// on vérifie si l'adhérent existe
Set T = BDP.Columns("B:B").Find(What:=AdheSup, LookIn:=xlValues, LookAt:=xlPart)
If T Is Nothing Then
MsgBox "L'adhérent n'a pas pu être supprimé. " & "Vérifiez que vous avez sélectionné un adhérent, " & "sinon consultez votre fichier."
Exit Sub
Else
vrep = MsgBox("Voulez-vous confirmer la suppression de cet adhérent ?", vbYesNo, vbQuestion)
If vrep = vbYes Then
' // On supprime les lignes correspondant au titulaire dans chaque feuille
Supprime_adherent AdheSup, "Adhé", "B", True
Supprime_adherent AdheSup, "Enf", "B", True
Supprime_adherent AdheSup, "Conj", "B", True
Else
Unload Me
End If
' // Retour à la feuille Accueil
Worksheets("Adhé").Visible = True
Worksheets("Adhé").Activate
' // On décharge le formulaire
Unload Me
End If
End Sub |
Partager