I have a collection (2D, 1 column to make it simple). Can I directly write it to a range or I need to convert it to an array to do that? Many thanks!
I have a collection (2D, 1 column to make it simple). Can I directly write it to a range or I need to convert it to an array to do that? Many thanks!
A collection cannot be written directly to a work sheet.
This code will take the elements of a collection and write them to a sheet. (Usually a collection holds objects, not values.)
I'm curious about your collection. Frequently, collections hold objects, not variables, so writing them to a sheet involves a property of the items in the collection, not the item itself.Please Login or Register to view this content.
Also, there is no such thing as a 2D collection. All collections are one dimensional.
Last edited by mikerickson; 01-09-2016 at 09:02 PM.
_
...How to Cross-post politely...
..Wrap code by selecting the code and clicking the # or read this. Thank you.
Thanks Mike! I use the collection to get unique values for a combo box items. Good to know there is only one dimension in collections. I can only deal with one column
However I always have to redim preserve and then transpose the array to get the values, even for 1 column:
Please Login or Register to view this content.
Last edited by aprildu; 01-11-2016 at 12:14 AM.
Perhaps you'd be interested in these codes. Neither uses a collection.Thanks Mike! I use the collection to get unique values for a combo box items.
Please Login or Register to view this content.
Please Login or Register to view this content.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks