Inverse of ItemsSelected

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.
 
K

Ken Snell \(MVP\)

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top