How to find out which Items are selected in a Multi-Select ListBox

Article contributed by Ibby

To determine which items are selected in a multi-select ListBox, you need to loop through all the items and check the Selected property:

Dim i As Long

' Items are indexed from zero
' Loop through all the items..

For i = 0 To ListBox1.ListCount - 1
    '..and check whether each is selected
    If ListBox1.Selected(i) Then
        ' If selected, display item in msgbox
        MsgBox ListBox1.List(i)
    End If
Next i


Click to view Terms of Use page

Click to view Disclaimer page