Private Sub btnsupprimer_Click()
Dim q As String
Dim i As Integer, fin&
i = 2
fin = Feuil6.Range("A" & Rows.Count).End(xlUp).Row
Do While Raison_sociale.Value <> Feuil6.Cells(i, 1)
i = i + 1
If i > fin Then MsgBox " La raison sociale n'existe pas ", vbExclamation: GoTo 1
Loop
q = MsgBox("Supprimer " & Raison_sociale & " ? ", vbQuestion + vbYesNo)
If q = vbYes Then
Feuil6.Rows(i).Delete
Recherche.ListBoxLocataire.RemoveItem Recherche.ListBoxLocataire.ListIndex
MsgBox "Elément supprimé", vbInformation
Unload Me
BD.Show: Exit Sub
End If
1 MsgBox " Veuillez rechercher la raison sociale à supprimer", vbInformation
Unload Me
BD.Show
End Sub