View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Filling 2 column list box with Collection?

For Each Item In MyCollection
With UserForm1.ListBox1
.AddItem Item
.list(.listcount - 1, 1) = "filename"
End With
Next Item

You said a collection, but not sure where the pathes and the filenames are
located unless you are parsing them out of the collection or you have arrays
in the collection. In any event, how you address the listbox is
illustrated - you should be able to adapt it to your data source.

--
Regards,
Tom Ogilvy


"What-a-Tool" wrote in message
news:M4W%c.17411$aW5.14719@fed1read07...
Have a collection containing folders and files that I want to put into a 2
column list box using a For Loop.
I have done this in Access vba and .Net apps, but I'm going crazy trying

to
get this to work in excel vba.
Can any one show or point me to a code sample demonstrating this, Please?

Found lots of samples of setting the list() property to an array, but
nothing on doing it row by row with a loop.

Thanks in advance for any help


--

/ Sean the Mc /


"I have not failed. I've just found 10,000 ways that won't work."
- Thomas Alva Edison (1847-1931)