title: Excel VBA Code - Combinations with restrictions
body: <p>I have to produce a list of combinations which are indicators to fields as I am trying to produce some conditions to interrogate data.I have some code for the combinations from <a href="https://www.mrexcel.com/forum/excel-questions/435865-excel-vba-combinations-permutations.html" rel="nofollow noreferrer">here</a>.</p>
  
  <p>In the example of Power/Torque/Cylinders with a combination of <code>1,2,4</code>: </p>
  
  <p><img src="https://i.stack.imgur.com/Eaoko.jpg" alt="Fields for combinations"> </p>
  
  <p>I need to work out the combinations of those 3 fields, so the output would be:</p>
  
  <p><img src="https://i.stack.imgur.com/Imqqp.jpg" alt="Example combinations within combination"></p>
  
  <p>So essentially all combinations but not from the same 'bucket' if that makes sense?</p>
  
  <p>Edit:
  The number of combinations (ie 3 in the example) will change as per the link I provided. The combinations from the link determine which field to look at or use. Eg combination 123 would be the first 3 fields in the image. Combination 1,2 would be tge first 2 and 1,3 would be first and last. I have the code for that.</p>
  
  <p>Now we have the combination buckets, need to work through the combinations across thise fields.</p>
  
  <p>Also I am looking for guidance on how to approach the algo and not necessarily someone to do it for me </p>
  
  <p>As another example, if 1,2,3 were  the column combination, the expected output would be:</p>
  
  <p>20-0.5-200</p>
  
  <p>20-0.5-300</p>
  
  <p>20-0.5-400</p>
  
  <p>etc</p>