0

I have a multidimensional array that is setup to hold a "identity number" as the first part of the array, and then a set of values as the second part. Ie

Dim holder(8,2) as integer

I'm trying to make holder(1) equal to a already defined array, as it is to many different values to write Instead of

Holer(1,1) = 1
Holder(1,2) =2

Etc

Do this

Holder(1) = Array(1,1,1)

Normally this wouldn't be a issue but I have multiple arrays

Ie

Holder(1) = Array(1,1,1)
Holder(2) = Array2(1,1,1)

How do I do this?

Another way to word it is put the values of array a into the holder array 1.

6
  • You have to create a loop, there is no way in VBA to do this with a single statement. However, have you thought about using a Dictionary? See for example stackoverflow.com/a/915333/7599798 Commented Feb 21, 2019 at 15:39
  • 1
    Before you go any further, do you realize that you are creating an array that is 9x3, i.e. 0 to 8, 0 to 2? See this. Commented Feb 21, 2019 at 15:53
  • Yes. This is a over simplification as well. I'm really dealing with a few hundred values Commented Feb 21, 2019 at 15:54
  • 1
    Second step would be to work with variant arrays not integer arrays if you plan to put child arrays into the elements of a parent array. Commented Feb 21, 2019 at 15:55
  • It doesn't matter whether your ubound is 8 or 8000. If you are skipping the lbound element you will run into trouble sooner than later. Commented Feb 21, 2019 at 15:56

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.