-
I need to declare a variable that will store the path and filename of each file the gets added to a listbox. I have no idea how many files there will be so it needs to be dynamic. I have no clue how to do this or if it is even possible. Please help and thanks for your help in advance.
-
The best thing to use here is a collection. declare it like this
Code:
Dim collMyCollection as Collection
then add the items like this
Code:
Dim i As Integer
Set collMyCollection = New Collection
For i = 0 To List1.ListCount - 1
collMyCollection.Add List1.List(i)
Next i
then Dim i As Integer
Set collMyCollection = New Collection
For i = 0 To List1.ListCount - 1
collMyCollection.Add List1.List(i)
Next i.Item(x) will give you the xth item on the list.
-
Thanks for the help. I'm going to try this tomorrow so I'll let you know how it goes. Do you know where I can get more info on collections and how they work??