List Property

List Property

See Also         Example         Applies To        

Returns or sets the list entries of a ListBox or ComboBox.

Syntax

object.List( row, column ) [= Variant]

The List property syntax has these parts:

Part Description
object Required. A valid object.
row Required. An integer with a range from 0 to one less than the number of entries in the list.
column Required. An integer with a range from 0 to one less than the number of columns.
Variant Optional. The contents of the specified entry in the ListBox or ComboBox.

Settings

Row and column numbering begins with zero. That is, the row number of the first row in the list is zero; the column number of the first column is zero. The number of the second row or column is 1, and so on.

Remarks

The List property works with the ListCount and ListIndex properties. Use List to access list items. A list is a variant array; each item in the list has a row number and a column number.

Initially, ComboBox and ListBox contain empty lists.

Note To specify items you want to display in a ComboBox or ListBox, use the AddItem method. To remove items, use the RemoveItem method.

Use List to copy an entire two-dimensional array of values to a control. Use AddItem to load a one-dimensional array or to load an individual element.