
Help..Newbie needs help with collections...and arrays
Hi,
My problem is simple but i cant seem to get it right,
I want a collection to hold 2 dim arrays...simple right...
This is what i tried...
Dim col As New Collection
Dim myarray(1 To 10, 1 To 10) As Integer
Private Sub Form_Load()
myarray(1, 1) = 10
col.Add (myarray) > i add an array 2 times
col.Add (myarray)
Debug.Print col.Count > just to make sure there are two items there
Debug.Print col.Item(1)(1, 1) > prints 10 like it should
Debug.Print col.Item(2)(1, 1) > prints 10 like it should also
col.Item(1)(1, 1) = 99 > here is where i think the
problem is
col.Item(2)(1, 1) = 100 THIS SHOULD WORK right?
Debug.Print col.Item(1)(1, 1) > prints 10 instead of 99
Debug.Print col.Item(2)(1, 1) > prints ten instead of 100
What did i do wrong....? can i do this? if i put them in a user type var
then store
them would that help.... ? how can i set a value in the array in the
collection...
Sorry for the double post i forgot my e-mail address in the first one...