Syntax

expression.List(Index)

expression A variable that represents a ControlFormat object.

Parameters

Name Required/Optional Data Type Description
Index Optional Variant The index number of a single text entry to be set or returned. If this argument is omitted, the entire list is returned or set as an array of strings.

Return Value
Variant

Remarks

Setting this property clears any range specified by the property.

Example

This example sets the entries in a list box on worksheet one. If Shapes(2) doesn't represent a list box, this example fails.

Visual Basic for Applications
Worksheets(1).Shapes(2).ControlFormat.List = _ Array("cogs", "widgets", "sprockets", "gizmos")

This example sets entry four in a list box on worksheet one. If Shapes(2) doesn't represent a list box, this example fails.

Visual Basic for Applications
Worksheets(1).Shapes(2).ControlFormat.List(4) = "gadgets"
Fill a drop-down list box from an array of text entries? list List Method Use an array of strings to fill a list box?

See also: