Hoping someone can help me fill in the missing piece of code.
I have a listbox that is filled with the contents of a rage in a worksheet, (sheet 1)-A2:A30. Also, a commandbutton that would allow the user to delete the contents of the selected item in listbox along with the corresponding cell within the worksheet range. When I execute the commandbutton it always deletes the contents of cell A1........
Private Sub CommandButton3_Click()
For X = 0 To ListBox1.ListCount - 1
If ListBox1.Selected(X) = True Then
Selection.clearcontents
End If
Next X
End Sub
Can someone point me in the right direction
I have a listbox that is filled with the contents of a rage in a worksheet, (sheet 1)-A2:A30. Also, a commandbutton that would allow the user to delete the contents of the selected item in listbox along with the corresponding cell within the worksheet range. When I execute the commandbutton it always deletes the contents of cell A1........
Private Sub CommandButton3_Click()
For X = 0 To ListBox1.ListCount - 1
If ListBox1.Selected(X) = True Then
Selection.clearcontents
End If
Next X
End Sub
Can someone point me in the right direction