ControlFormat.MultiSelect property (Excel)

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.

Syntax

expression.MultiSelect

expression A variable that represents a ControlFormat object.

Remarks

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.

Example

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

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.