ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   List Box - MultiSelect (https://www.excelbanter.com/excel-programming/322071-list-box-multiselect.html)

Bill[_28_]

List Box - MultiSelect
 
Hello,
I have a list box where a user can select multiple items. How do I figure
out which items are selected using VBA? I thought there was a selecteditem
property, but I don't seem to find it.

Thanks,

Bill



Bob Phillips[_6_]

List Box - MultiSelect
 
Hi Bill,
Here is some code as a starter


With Me.ListBox1
For i = 0 To .ListCount - 1
If .Selected(i) Then
Msgbox .List(i)
End If
Next i
End With



--

HTH

RP
(remove nothere from the email address if mailing direct)


"Bill" wrote in message
...
Hello,
I have a list box where a user can select multiple items. How do I figure
out which items are selected using VBA? I thought there was a

selecteditem
property, but I don't seem to find it.

Thanks,

Bill





Bill[_28_]

List Box - MultiSelect
 
Bob,

Thanks a lot. I appreciate it.

"Bob Phillips" wrote in message
...
Hi Bill,
Here is some code as a starter


With Me.ListBox1
For i = 0 To .ListCount - 1
If .Selected(i) Then
Msgbox .List(i)
End If
Next i
End With



--

HTH

RP
(remove nothere from the email address if mailing direct)


"Bill" wrote in message
...
Hello,
I have a list box where a user can select multiple items. How do I
figure
out which items are selected using VBA? I thought there was a

selecteditem
property, but I don't seem to find it.

Thanks,

Bill








All times are GMT +1. The time now is 12:27 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com