ListBox_SelectedIndexes

Create list of selected items in MSForms listbox as string separated by | Or blank if none is selected.
You may also use ListBox_SelectionCount

CodeFunctionName
What is this?

Public

Tested

Original Work
Function ListBox_SelectedIndexes(LiBox As MSForms.Listbox, Optional Sepa="|")
    ' Returns list of selected items (ListIndex) from a listbox as string sperated with |
    '    Returns blank if none is selected
    Rett = ""
    For I = 1 To LiBox.ListCount
        If LiBox.Selected(I - 1) Then
            If Rett > "" Then Rett = Rett & Sepa
            Rett = Rett & I - 1
        End If
    Next
    ListBox_SelectedIndexes = Rett
End Function

LiBox, Optional Sepa

Views 4,468

Downloads 1,414

CodeID
DB ID