List Method 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.

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.

Worksheets(1).Shapes(2).ControlFormat.List(4) = "gadgets"