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.

fftk4323
  • 130
  • 1
  • 12
  • 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 https://stackoverflow.com/a/915333/7599798 – FunThomas Feb 21 '19 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](https://stackoverflow.com/questions/54793905/excel-vba-mysterious-zero-is-being-added-to-array-created-with-for-loop/54794276#54794276). –  Feb 21 '19 at 15:53
  • Yes. This is a over simplification as well. I'm really dealing with a few hundred values – fftk4323 Feb 21 '19 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. –  Feb 21 '19 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. –  Feb 21 '19 at 15:56
  • Oh okay. Biy of miscommunication. I want to assign values of array a to the second part of the multi dimensional array. – fftk4323 Feb 21 '19 at 15:56

0 Answers0