Tag Archives: reverse

To reverse a collection

Environment: VBA
Function: To reverse a collection

Dim Reversed As Collection
Set Reversed = New Collection ‘DONT FORGET THIS
For i = 1 To Collection.Count ‘Collection Starts with 1!
Reversed.Add(Collection.Item(Collection.Count – i + 1))
Next

Advertisements