Supprimer ligne Excel via une recherche par combobox

Bonjour,

Je désirerais supprimé une ligne de tableau excel

Exemple, la combobox reprend les numéros de client enregistré dans la liste, tous noté dans colonne A de ma feuille ClientList

J'aimerais que le bouton supprimer puisse effacer la ligne complète ou est situé le numéro sélectionné dans la combobox de suppression.

Mon code actuel pour le bouton est le suivant mais il ne fonctionne pas:

Private Sub CommandButtonSupp_Click()
    For i = 1 To 9999 Step 1
        If (Worksheets("ClientList").Cells(i, 1)) = ComboBoxDelete.Value Then
        Worksheets("ClientList").Rows(i).Delete
        End If
    Next i
End Sub

Merci d'avance

Bonjour,

A tester

Private Sub CommandButtonSupp_Click()
Sheets("ClientList").Select
Rows([A2:A65536].Find(ComboBoxDelete.Value).Row).EntireRow.Delete
End Sub

@+

Bonsoir,

ci-dessous exemple de code:

Private Sub CommandButtonSupp_Click()
    Dim cell As Range

    With Sheets("ClientList")
        Set cell = .Columns("A").Find(ComboBoxDelete, lookat:=xlWhole)
        If Not cell Is Nothing Then cell.EntireRow.Delete
    End With

End Sub

Bonsoir,

ci-dessous exemple de code:

Private Sub CommandButtonSupp_Click()
    Dim cell As Range

    With Sheets("ClientList")
        Set cell = .Columns("A").Find(ComboBoxDelete, lookat:=xlWhole)
        If Not cell Is Nothing Then cell.EntireRow.Delete
    End With

End Sub

Salut, ton code fonctionne nickel merci et bonne journée.

Rechercher des sujets similaires à "supprimer ligne via recherche combobox"