Z
Zigs
I am trying to assign an array to an array to create a jagged array. I
am not sure if this is possible in VBA because when i searched online
the examples were given in VB.Net, but here is the code that I am
using to do this:
Dim vArr1(1 to 10) as Variant
Dim vArr2(1 to 10) as Variant
Dim vMainArr(1 to 2) as Variant
Dim lCounter as Long
'Populate the sub arrays:
For lCounter = 1 to 10
vArr1(lCounter) = lCounter
vArr2(lCounter) = lCounter
Next lCounter
'Assign the sub arrays to the main array:
vMainArr(1) = vArr1
vMainArr(2) = vArr2
However, an error is thrown at the two lines of code above.
am not sure if this is possible in VBA because when i searched online
the examples were given in VB.Net, but here is the code that I am
using to do this:
Dim vArr1(1 to 10) as Variant
Dim vArr2(1 to 10) as Variant
Dim vMainArr(1 to 2) as Variant
Dim lCounter as Long
'Populate the sub arrays:
For lCounter = 1 to 10
vArr1(lCounter) = lCounter
vArr2(lCounter) = lCounter
Next lCounter
'Assign the sub arrays to the main array:
vMainArr(1) = vArr1
vMainArr(2) = vArr2
However, an error is thrown at the two lines of code above.