Inverse of ItemsSelected

  • Thread starter Thread starter Janie
  • Start date Start date
J

Janie

I need the inverse of ItemsSelected ... that is, I need something that to
happen to the items NOT selected from the ListBox

Something like (yes, I know this doesn't work but go with the theory of it):

For Each varItm NOT In ctl.ItemsSelected
Debug.Print ctl.ItemData(varItm)
Next varItm

Suggestions on how to process what WASN'T selected as opposed to what was?

Thanks for any ideas.
 
Loop through all the items in the listbox object, and read the Selected
property:

Dim intCurrentRow As Long
For intCurrentRow = 0 To Me.NameOfListBox.ListCount - 1
If Me.NameOfListBox.Selected(intCurrentRow) = False Then
' put your code here for what you want to do when the item is NOT
selected

End If
Next intCurrentRow
 
Back
Top