Hi, normally I use the code below to remove selected (highlighted) listbox items.
Now I have a listbox with the Style property set to 'Checkbox', but the code below doesn't work anymore. Instead of removing the selected/highlighted items it removes items with a ticked checkbox.
How can I remove the selected/highlighted items and ignore the items with ticked checkbox? I searched the forums, but couldn't find an answer.
vb Code:
Private Sub cmdRemove_Click() Dim i As Long With List1 For i = .ListCount - 1 To 0 Step -1 If .Selected(i) = True Then .RemoveItem i End If Next End With End Sub




Reply With Quote