Saturday, January 16, 2016

How to get multi selected item in Listbox VBA


Set Listbox property, MultiSelect : fmMultiSelectMulti



1
2
3
4
5
6
7
8
9
Private Sub CommandButton1_Click()
Dim i As Long, msg As String
    For i = 0 To ListBox1.ListCount - 1
        If ListBox1.Selected(i) = True Then
            msg = msg & ListBox1.List(i) & vbCrLf
        End If
    Next i
    MsgBox msg
End Sub




Download File

No comments :

Post a Comment