A
Alex St-Pierre
I would like to add things in my collection but doesn't work all the time.
If I write:
Dim C as New Collection
For j = 1 To 10
C.Add Cells(j,5), Cells(j,5)
Next j
C(2) = C(1) 'this works
If I want to add other things then cells(j,5), it doesn't work
Dim C as New Collection
Dim D as New Collection
Dim Temp as Object
For j = 1 To 10
Temp = "A->C" 'Temp = Nothing ?
Temp2 = "A->C" 'Temp2 is not empty
C.Add Temp, Temp 'doesn't work because Temp is empty
D.Add Temp2, Temp2 'seems to work but D(2) = D(1) doesn't work (object
required)
Next j
If I write:
Dim C as New Collection
For j = 1 To 10
C.Add Cells(j,5), Cells(j,5)
Next j
C(2) = C(1) 'this works
If I want to add other things then cells(j,5), it doesn't work
Dim C as New Collection
Dim D as New Collection
Dim Temp as Object
For j = 1 To 10
Temp = "A->C" 'Temp = Nothing ?
Temp2 = "A->C" 'Temp2 is not empty
C.Add Temp, Temp 'doesn't work because Temp is empty
D.Add Temp2, Temp2 'seems to work but D(2) = D(1) doesn't work (object
required)
Next j