DropDown Object

Description

Represents a drop-down list box on the specified chart sheet, dialog sheet, or worksheet, or a combination drop-down edit box on the specified dialog sheet. A user can click an item in the drop-down list or, in combination drop-down edit boxes, type text in the edit box.

You can fill the drop-down list either by specifying a range of cells that contains list items (using the ListFillRange property) or by specifying each item (using the AddItem and RemoveItem methods or the List property).

Accessors

The DropDown object is a member of the DropDowns collection. The DropDowns collection contains all the DropDown objects on a single sheet. Use the Add method to create a new drop-down list box and add it to the collection. Set the editable argument to True to create a combination drop-down edit box (you can only create a combination drop-down edit box on a dialog sheet).

To access a single member of the collection, use the DropDowns method with the index number or name of the drop-down list box as an argument.

Example

The following example sets the items that appears in the drop-down list box when the dialog sheet runs.


DialogSheets(1).DropDowns(1).List = _
    Array("cogs", "widgets", "gadgets", "sprockets")

The drop-down list box name is shown in the Name Box when the drop-down list box is selected. Use the Name property to set or return the drop-down list box name.

The following example sets the list input range for the drop-down list box named "Drop Down 9." When the dialog sheet runs, the contents of cells A1:A10 on the worksheet named "Sheet1" will appear in the drop-down list box.


DialogSheets(1).DropDowns("drop down 9") _
    .ListFillRange = "=sheet1!a1:a10"

Properties

Application Property, BottomRightCell Property, Caption Property, Creator Property, Display3DShading Property, DropDownLines Property, Enabled Property, Height Property, Index Property, Left Property, LinkedCell Property, LinkedObject Property, List Property, ListCount Property, ListFillRange Property, ListIndex Property, Locked Property, Name Property, OnAction Property, Parent Property, Placement Property, PrintObject Property, Text Property, Top Property, TopLeftCell Property, Value Property, Visible Property, Width Property, ZOrder Property.

Methods

AddItem Method, BringToFront Method, Characters Method, Copy Method, CopyPicture Method, Cut Method, Delete Method, Duplicate Method, RemoveAllItems Method, RemoveItem Method, Select Method, SendToBack Method.