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:
  1. Private Sub cmdRemove_Click()
  2.     Dim i As Long
  3.  
  4.     With List1
  5.         For i = .ListCount - 1 To 0 Step -1
  6.             If .Selected(i) = True Then
  7.                 .RemoveItem i
  8.             End If
  9.         Next
  10.     End With
  11. End Sub