List Property

Applies To

CommandBarComboBox object.

Description

Returns or sets the value of a list item in the command bar combo box control. Read/write String.

Note This property is read-only for built-in combo box controls.

Syntax

expression.List(Index)

expression Required. An expression that returns a CommandBarComboBox object.

Index Required Long. The list item to be set.

See Also

Execute method, ListBy property, ListCount property, ListHeaderCount property, ListIndex property.

Example

This example checks the value of the fourth list item in the combo box control named "Vegetables" on the command bar named "Custom." If the value is "Tomato," the code specified by the OnAction property of the command bar control is run.

Set myBar = CommandBars("Custom")
Set myControl = myBar.Controls("Vegetables")
If myControl.List(4) = "Tomatoes" Then myControl.Execute