Collection Issue
Hi Cody,
Apparently collection is not a valid type for Public variables so I need
to
know how to pass collections between modules.
In Module1
'-------------
Option Explicit
Public MyCol As Collection
Sub Demo()
Dim i As Long
Set MyCol = New Collection
For i = 1 To 10
MyCol.Add "Book" & i, CStr(i)
Next i
End Sub
In Module2
'-------------
Option Explicit
Sub TestIt()
Dim i As Long
For i = 1 To MyCol.Count
Debug.Print MyCol(i)
Next i
End Sub
---
Regards,
Norman
"Cody" wrote in message
...
I have created a collection in a module and I would like to use the values
in
the collection in another module.
Apparently collection is not a valid type for Public variables so I need
to
know how to pass collections between modules.
Thanks for any help.
|