I've found something that I don't quite understand. Please help explain.
so I used this code to assign values within named ranges to an array. (see below).
Dim accountStructure As Variant
ReDim accountStructure(2)
accountStructure(0) = Range("namedrange1")
accountStructure(1) = Range("namedrange2")
accountStructure(2) = Range("namedrange3")
The code works. However, in order to call the first item in accountstructure(0) I need to type accountStructure(0)(1,1), second item accountStructure(0)(2,1) third item (0)(3,1) and so on. I understand why there is (0) there but I don't understand why there is always a 1 after the item number. Please help me understand this.
Dim rng as Range Set rng=Range("A1:A10")We can assignDim arr As varient arr=rngBut we have to treat it as two dimensional array. Because Excel VBA does'nt "know" it is one dimensional. So we can nowFor i=1 To 10 arr(i,1) = i Next