objectvariable(required; Collection Object)
An object variable of the Collection type
The ordinal position of the item to remove
The key of the item to remove
Removes a member from a collection
Members of the collection that follow the removed member are automatically moved downward by one ordinal position; therefore, no gaps are left in the collection.
Because the collection is reindexed after each deletion, you should
be sure not to delete a member of the collection based on a stored
numeric value of
index, since this value
could change. Instead, you should either delete the member by key or
retrieve the index value just before calling the Remove method.
If you are deleting multiple members of a collection by numeric index value, you should delete them backwards — from highest index value to lowest — because the collection is reindexed after each deletion.
If you are using a collection as the basis for a class module, or if you are using functions in your application to wrap and enhance the limited functionality of a collection, you can include a Clear method to remove all the members in your collection. The method should be written to remove the member in position 1 until no members are left, as the following code demonstrates: ...