We help IT Professionals succeed at work.

Other multi select listboxes in MS Excel 365

Frans_Truyens
Frans_Truyens asked
on
I am looking for nice listboxes in MS Excel. I know that there are multiselect listboxes in MS Excel, which can be controlled through VBA. But I want one that has the layout of a the filter dropdowns, with checkboxes where you can select the options.
Comment
Watch Question

Top Expert 2016

Commented:
Hi,

in VBA the normal Listbox can have check boxes if you set ListBox1.ListStyle = fmListStyleOption

Private Sub UserForm_Initialize()
    With ListBox1
        .ColumnCount = 3
        .ColumnWidths = "1cm;2cm;2cm"
        '.ColumnHeads = True
    ListBox1.RowSource = "Sheet1!A2:C10"
    ListBox1.ListStyle = fmListStyleOption

    End With
End Sub

Open in new window

Regards

Author

Commented:
I will try thanks

Author

Commented:
No this does NOT work.

Set lst = Sheets("Sheet4").ListBoxes("lstTest")
lst.ListStyle = fmListStyleOption

Author

Commented:
the listbox property is not supported.
Top Expert 2016

Commented:
I meant a listbox in a form

Author

Commented:
I am using a listbox in a sheet. But the property isn't there?
Top Expert 2016
Commented:
pls try

Set lst = Sheets("Sheet4").ListBoxes("lstTest")
lst.Object.ListStyle = 1 'fmListStyleOption
lst.Object.MultiSelect = 1

Author

Commented:
I returned home. I will try it monday at my work. I will continue Monday morning.

Author

Commented:
Rgonzo1971
this does not work. I am working with Excel 365
 
Sorry for the delay. I was at another customer's site last week.
Top Expert 2016

Commented:
Sorry can't help further

Author

Commented:
Is there another solution? I have found on the internet that you solution works with Office 2003, but I am working with Office 365.
Top Expert 2016

Commented:
HI,

pls try

Sub Macro()
Set s = Selection
For Each shp In ActiveSheet.Shapes
    If shp.Type = msoOLEControlObject Then
        Set lstbx = shp
        Exit For
    End If
Next
lstbx.OLEFormat.Object.Object.ListStyle = fmListStyleOption
lstbx.OLEFormat.Object.Object.MultiSelect = 1
End Sub

Open in new window

EE20150309.xlsm

Author

Commented:
I downloaded your file. But I am not able to check/uncheck the checkboxes.  Is it possible to check/uncheck? Or how does this work?
Top Expert 2016

Commented:
But can you select one of the lines

Author

Commented:
No. I looks like an image.
Top Expert 2016

Commented:
then like I said
can't help further

Author

Commented:
Anyone else can help?
Martin Liss"There is still no cure for the common birthday." ~John Glenn
Most Valuable Expert 2017
Distinguished Expert 2018

Commented:
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.