Array of Public Arrays

H

Hari Prasadh

Hi,

How to define Array of Arrays where all the arrays are Public.

Problem is size of public array and the size of array of public arrays is
calculated programmatically (both are dynamic arrays).

I have used the Redim statement but not able to implement in this case.
 
T

Tom Ogilvy

You don't declare an array of arrays

You declare an array of type variant, then assign arrays to its elements.

Public v() as Variant

sub Set array()

redim v(1 to 3)

v(1) = Array(1,2,3,4,5,6,7)
v(2) = Array("a","b","c")
v(3) = Array("Tom","Dick","Harry")

msgbox v(2)(3)

End Sub
 

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