(Solved) – delete a line or item selected on listbox of userform

  • by

I have a userform where I can enter some informations, but I want also to give the user the possibilty to delete the data that he entred by selecting it from listbox and then click on delete and they need to put a password
but unfortunately I tried this code that I found on youtube but it’s doesn’t work

Private Sub delete_Click()
Dim i As Integer
  For i = 1 To Range("A65656").End(xlUp).Row
    If lstdiplay.Selected(i) Then
      Rows(i   1).Selected
    End If
  Next i
End Sub

When I select for example XOXO like the picture, and click on DELETE, i want to delete the entire informations about XOXO, does mean delete XOXO and SA and his number phone etc…..and yes I have the same data on worksheet and After deleting data cells i want to remain blank

Picture of listbox

Leave a Reply

Your email address will not be published. Required fields are marked *