Vba setup list box in Excel
For example, I have a Activex listbox "Countries". I want to allow users to select more than one country in the list.
To do it in Excel, here is the answer:
- Option Explicit
- Sub EnableListBoxMultiSelect()
- ActiveSheet.Countries.MultiSelect = fmMultiSelectMulti
- End Sub
a) Line 3 sets up the ListBox to support multiple values selection by user.
b) To support only one value selection, the MultiSelect propert should be set to "fmMultiSelectSingle" instead of "fmMultiSelectMulti"