Let’s say you get a string of array-Dimensions from the Database. It would look something like this: "[1][2][1]" now you have a corresponding value, we shall call it B
I have to create an array of this format: (x,(B))
if another Value, we call it A had this Dimension-String: [1][1], the array shall be filled like this: (A,(B))
and if by chance there is another Value named C with the String[1][2][2] the array is supposed to look like this: (A,(B,C))
i thought of something like :
Redim Array1(1)
Redim Array2(1)
Array1(0) = A
Array2(0) = B
Array2(1) = C
Array1(1) = Array2()
But that in a dynamic way. It seems to me, that vba does not support nested arrays.
Unfortunately a Multi-dimensional array will not work, as the “dimensions” are not consistent. any help appreciated
Edit:
tried:
c = 0
dim array1() as Variant
redim preserve array1(c)
array1(c) = split(mid("[1][4]",2,len("[1][4]")-2),"][")
and it gave me a type mismatch error
This works: