Supprimer ligne listview/feuille

bonjour le forum

je reviens non pas sur la contribution https://forum.excel-pratique.com/excel/variable-pour-delete-t48376.html de Banzai64 qui fonctionne bien la où elle était destinée mais je voudrais l'adapter a une listview

voici ma modification

Private Sub sup_cli_Click()

 Dim Nb As Integer
With Listclient
  Nb = .ListItems.Count
 'If Me.ListBox1.ListIndex = -1 Then
    MsgBox "Faites un choix d'abord"
    Exit Sub
 ' End If
  Sheets("client").Range("P" & Me.Listclient.ListSubItems + 2).Delete Shift:=xlShiftUp
  Me.Listclient.RemoveItem Me.Listclient.ListItems
End With
End Sub

qui bien sur bug

la listview est nommée Listclient

en fait je voudrais supprimer une ligne dans la listview et sur la feuille également

je prépare un fichier au cas où

Pascal


bonjour a vous tous

voici le fichier pour aider

Pascal

bonsoir a vous

j'ai modifier mon code comme ceci et cela fonctionne

Private Sub sup_cli_Click()

    With Listclient.ListItems
       Sheets("client").Range("P" & Me.Listclient.SelectedItem.Index + 1).Delete Shift:=xlShiftUp
      Me.Listclient.ListItems.Remove (Me.Listclient.SelectedItem.Index)
    End With
    End Sub

bon courage a tous

Pascal

Rechercher des sujets similaires à "supprimer ligne listview feuille"