RedditPP Mascot

RedditPP

r/vba • … • u/Bishop_Colubra

Is there a way to declare arrays with an undetermined number of dimensions?

As far as I know, when one wants to declare an array, the code is something like:

>Dim Array1() as String

>...

>Redim Array1(x,y,x)

Above, one needs to know before the Redim statement that Array1() has three dimensions (x,y, and z).

Is there a way to use a variable or other method to determine how many dimensions Array1() has in case one doesn't know before run time how many elements Array1() will need?

— 0