RemoveItem Method

Applies To

DrawingObjects Collection, DropDown Object, DropDowns Collection, ListBox Object, ListBoxes Collection.

Description

Removes one or more items from a list box or drop-down list box.

Syntax

object.RemoveItem(index, count)

object

Required. The object to which this method applies.

index

Required. Specifies the number of the first item to remove. Valid values are from one to the number of items in the list (returned by the ListCount property).

count

Optional. Specifies the number of items to remove starting at item index. If this argument is omitted, one item is removed. If index + count exceeds the number of items in the list, all items from index through the end of the list are removed without an error.

Remarks

This method fails if the object has a ListFillRange defined.

See Also

AddItem Method, List Property, RemoveAllItems Method.

Example

This example removes the first entry from list box one on Dialog1.


DialogSheets("Dialog1").Listboxes(1).RemoveItem index:=1