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

Post a comment or leave a trackback: Trackback URL.

Leave a comment