title | keywords | f1_keywords | api_name | ms.assetid | ms.date | ms.localizationpriority | ||
---|---|---|---|---|---|---|---|---|
ControlFormat.MultiSelect property (Excel) |
vbaxl10.chm630087 |
|
|
5ec1e5b6-37ab-465b-bf81-4955f6fd0f31 |
04/23/2019 |
medium |
Returns or sets the selection mode of the specified list box. Can be one of the following constants: xlNone, xlSimple, or xlExtended. Read/write Long.
expression.MultiSelect
expression A variable that represents a ControlFormat object.
Single select (xlNone) allows only one item at a time to be selected. Choosing the mouse or pressing the Spacebar cancels the selection and selects the chosen item.
Simple multiselect (xlSimple) toggles the selection on an item in the list when it's chosen with the mouse or the Spacebar is pressed when the focus is on the item. This mode is appropriate for pick lists, in which there are often multiple items selected.
Extended multiselect (xlExtended) usually acts like a single-selection list box, so when you choose an item, you cancel all other selections. When you hold down Shift while choosing the mouse or pressing an arrow key, you select items sequentially from the current item. When you hold down Ctrl while choosing the mouse, you add single items to the list. This mode is appropriate when multiple items are allowed but not often used.
Use the Value or ListIndex property to return and set the selected item in a single-select list box.
You cannot link multiselect list boxes by using the LinkedCell property.
This example creates a simple multiselect list box.
Set lb = Worksheets(1).Shapes.AddFormControl(xlListBox, _
Left:=10, Top:=10, Height:=100, Width:100)
lb.ControlFormat.MultiSelect = xlSimple
[!includeSupport and feedback]