title: Redim variable number of dimensions in VBA
body: <p>I have a case in an Excel macro (VBA) where I'd like to dimension an array where the number of dimensions and the bounds of each dimension are determined at runtime. I'm letting the user specify a series of combinatorial options by creating a column for each option type and filling in the possibilities below. The number of columns and the number of options is determined at run time by inspecting the sheet.</p>
  
  <p>Some code needs to run through each combination (one selection from each column) and I'd like to store the results in a multidimensional array. </p>
  
  <p>The number of dimensions will probably be between about 2 to 6 so I can always fall back to a bunch of if else blocks if I have to but it feels like there should be a better way. </p>
  
  <p>I was thinking it would be possible to do if I could construct the <code>Redim</code> statement at runtime as a string and execute the string, but this doesn't seem possible.</p>
  
  <p>Is there any way to dynamically <code>Redim</code> with a varying number of dimensions?</p>