VBA New Collection

jstevens
GoldLounger
Posts: 2618
Joined: 26 Jan 2010, 16:31
Location: Southern California

VBA New Collection

Post by jstevens »

I have a code that creates a new collection and can successfully list out the count of the items in the collection.

Code: Select all

Dim i as long
For i = 1 to myCollection.Count
     Cells(i,1)  = i
Next i
What I would like to do it list the item name of the collection. I have tried myCollection.Item.FullName and was not successful.

Regards,
John
Regards,
John

User avatar
HansV
Administrator
Posts: 78237
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: VBA New Collection

Post by HansV »

For example:

Cells(i, 1) = myCollection(i)
Best wishes,
Hans

User avatar
HansV
Administrator
Posts: 78237
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: VBA New Collection

Post by HansV »

You'll have to post the complete code, otherwise I don't have the slightest idea what you're doing.

Added: this is a reaction to a reply that seems to have vanished
Best wishes,
Hans

jstevens
GoldLounger
Posts: 2618
Joined: 26 Jan 2010, 16:31
Location: Southern California

Re: VBA New Collection

Post by jstevens »

Hans,

I was able to get it to work after a reboot

Thanks
Regards,
John

User avatar
HansV
Administrator
Posts: 78237
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: VBA New Collection

Post by HansV »

OK, thanks for the feedback.
Best wishes,
Hans