MultiSelect Listbox (Forms Toolbar)

  • Thread starter Thread starter Ryan Holmes
  • Start date Start date
R

Ryan Holmes

I am using a list box from the Forms Toolbar (i.e. NOT the
ActiveX one from the Control Toolbox). However I can find
no way, either through Excel itself or through VBA code,
to find out which items are selected if the list box is
set to "Multiple" or "Extend" mode. Extensive searches on
Google and the Microsoft site have come up with nothing.

Is this not possible to do? And if not, then why is the
option given to set the list box to anything other
than "Single" select mode?

Thank you muchly to anyone who manages to reduce my
increasing insanity over this issue.
 
I think you'll have to use VBA to get all the selected items.

I put a Button from the Forms toolbar and assigned this macro to that button:

Option Explicit
Sub btnClick()

Dim iCtr As Long

With Worksheets("sheet1").ListBoxes("list box 1")
For iCtr = 1 To .ListCount
If .Selected(iCtr) Then
MsgBox .List(iCtr)
End If
Next iCtr
End With

End Sub
 

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

Back
Top