Created
December 11, 2013 20:47
-
-
Save stephanecoinon/7918179 to your computer and use it in GitHub Desktop.
VBA converts a collection to array
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
' Source: http://www.iwebthereforeiam.com/iwebthereforeiam/2004/06/excel-vba-code-to-convert-coll.html | |
Function collectionToArray(c As Collection) As Variant() | |
Dim a() As Variant: ReDim a(0 To c.Count - 1) | |
Dim i As Integer | |
For i = 1 To c.Count | |
a(i - 1) = c.Item(i) | |
Next | |
collectionToArray = a | |
End Function |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment