Jagged Arrays

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.
 
B

Bob Phillips

Worked fine for me. What error did you get?

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top