title: VBA looping through all dimensions of an array?
body: <p>Is it possible to loop through all dimensions of an array?
  I found a workaround to get the number of dimension of an array. But now I want be able to iterate over this. Without knowing the exact count of dimensions <strong>before runtime</strong>.</p>
  
  <p>Example: If you want to iterate over a 2- dimensional array. You already know the number of dims. Therefore you will write the code something like that:</p>
  
  <pre><code>var = MyArray(1,2)
  </code></pre>
  
  <p>or with iteration var:</p>
  
  <pre><code>For n = 1 to Ubound(vArray)
      For n2 1 to Ubound(vArray, 2)
          var = MyArray(n, n2)
      Next n2
  Next n
  </code></pre>
  
  <p>But in my case I don't know the exact number of dimensions before runtime. It could be only one, two or even more. So how I write the command?</p>
  
  <pre><code>For d = 1 to NumberOfDimensions
      For n = 1 to Ubound(vArray, d)
          var = MyArray(???)
      Next n
  Next d
  </code></pre>
  
  <p>My goal is to iterate over all the elements in all dimensions of that array.</p>
  
  <p>Any ideas? Thanks in advance. :)</p>