title: Combining Multiple Arrays in VBA
body: <p>I am currently trying to combine 46 arrays in to a single array. I have scoured the internet, to no prevail and am hoping someone here can help. I did find the below page, but I need to be able to look through each element of the new array in a nested for loop, so using the method below doesn't quite get me to my end goal.</p>
  
  <p><a href="https://stackoverflow.com/questions/47155960/excel-vba-combine-multiple-arrays-into-one">Excel vba - combine multiple arrays into one</a></p>
  
  <p>Basically, I need to combine my set of 46 arrays in such a way that I can then loop through each element using a nested for loop. ie.</p>
  
  <p>Set of arrays:</p>
  
  <pre><code>myArray1 = (1, 2, 3, 4)
  myArray2 = (5, 6, 7)
  myArray3 = (8, 9)
  myArray4 = (10, 11, 12, 13, 14)
  .
  .
  .
  myArray46 = (101, 102, 103)
  </code></pre>
  
  <p>Combine them to form new array:</p>
  
  <pre><code>myNewArray = (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14... 101, 102, 103)
  </code></pre>
  
  <p>Loop through in nested for loop to check each element against my main array:</p>
  
  <pre><code>For i = LBound(mainArray) to UBound(mainArray)
      For j = LBound(myArray) to UBound(myArray)
  
      If mainArray(i) = myArray(j) Then
      'do something
      End If
  
      Next j
  Next i
  </code></pre>
  
  <p>Any help and/ or guidance with this is greatly appreciated!</p>