title: Finding all possible combos for n * m array, excluding certain values
body: <p>I have an array that can vary in size, with n columns and m rows, and I need to find all the combinations of one element for each row/column combination, but exclude any combinations where the element is zero. So, in practice, if I have:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>Row</th>
  <th>Item1</th>
  <th>Item2</th>
  <th>Item3</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>1</td>
  <td>A</td>
  <td>B</td>
  <td>C</td>
  </tr>
  <tr>
  <td>2</td>
  <td>D</td>
  <td>E</td>
  <td>F</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>I will have 2^3 = 8 possible combinations: <strong>ABC</strong>, <strong>ABF</strong>, AEC, AEF, <strong>DBC</strong>, <strong>DBF</strong>, DEC, DEF.</p>
  <p>But if instead of B I have a zero in row 1 Item2, I want to exclude that cell from the list of combinations (in <strong>bold</strong> above), so I would end up with: AEC, AEF, DEC and DEF.</p>
  <p>I found some code that give me all the possible combinations on a fixed number of columns (<a href="https://stackoverflow.com/questions/5729967/macro-to-make-all-possible-combinations-of-data-in-various-columns-in-excel-shee/5731496#5731496">Macro to make all possible combinations of data in various columns in excel sheet</a>), but it doesn't account for an array that can change dimensions, or for the exclusion rule above.</p>