Items - Add / Remove


Adding


The key can be any data type.
The item can be any data type.



A Dictionary object can also be used although to populate the dictionary you need to loop through the array.
This will also need a reference to the Microsoft Scripting Runtime library.


Remove Method



RemoveAll Method

This method removes all items in the Dictionary object
A collection object on the other hand has no method for quickly removing all the items at once.
This can be achieved by setting the Collection to Nothing.



Adding Excel Ranges


You don't have to add a Range object, you can add Range.Value to store a 1 dimensional array.



© 2026 Better Solutions Limited. All Rights Reserved. © 2026 Better Solutions Limited TopPrevNext