Find range subset combinations from main range

chuckjitsu

New Member
Joined
Apr 24, 2015
Messages
9
Hi there. Here are the particulars. Let's say you have a 10 X 10 range of cells- A1:J10 will work fine. What I'm trying to find via VBA is how many pairs of non intersecting ranges containing 5 cells and 4 cells can be derived from the main range of A1:J10. For example, A1:A5 (5 cell subset) and A6:A9 (4 cell subset) would be a valid pair. A1:A5 and A1:A4 would not be a valid pair due to the intersection of ranges at A1. I'm mostly just looking for the number of valid pairs, but if somebody wants to show how to physically list all the pairs on a worksheet as well I won't be offended!

Thanks in advance for the help!
 

Some videos you may like

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.

Watch MrExcel Video

Forum statistics

Threads
1,119,063
Messages
5,575,907
Members
412,689
Latest member
nhsmedic
Top