Hi all!
I usually lurk in these forums for all my VBA questions. There are several real nuggets of advice and solutions. I am always able to combine code and learn of the solutions offered. However, I can't get the following problem fixed... Basically I got a dynamic amount of columns in one sheet. I want to compare all possible combinations of columns in a separate sheet. So if I got Column A t/m F on the main sheet, I want a sheet for column A & B, one sheet for A & C, one sheet for A & D, etc... until the last sheet that consists of E & F.
<tbody>
</tbody>
The issue is that the amount of columns is dynamic. So sometimes its 10, sometimes 15 and it can run up to 20. I am currently struggling to get it done with a double column loop, but I think I am thinking in the wrong direction.
Is there anyone who can give me a push in the right direction ?
Thanks in advance,
Koen
I usually lurk in these forums for all my VBA questions. There are several real nuggets of advice and solutions. I am always able to combine code and learn of the solutions offered. However, I can't get the following problem fixed... Basically I got a dynamic amount of columns in one sheet. I want to compare all possible combinations of columns in a separate sheet. So if I got Column A t/m F on the main sheet, I want a sheet for column A & B, one sheet for A & C, one sheet for A & D, etc... until the last sheet that consists of E & F.
Main sheet: | Sheet 1: | Sheet 2: | Sheet 3: | |||||||||||
ColumnA | ColumnB | ColumnC | ColumnD | ColumnE | ColumnF | ColumnA | ColumnB | ColumnA | ColumnC | ColumnA | ColumnD | |||
16 | 13 | 17 | 12 | 16 | 19 | 16 | 13 | 16 | 17 | 16 | 12 | |||
8 | 5 | 9 | 10 | 3 | 4 | 8 | 5 | 8 | 9 | 8 | 10 | |||
13 | 11 | 15 | 16 | 13 | 18 | 13 | 11 | 13 | 15 | 13 | 16 | |||
13 | 16 | 6 | 20 | 2 | 19 | 13 | 16 | 13 | 6 | 13 | 20 | |||
11 | 18 | 5 | 15 | 8 | 18 | 11 | 18 | 11 | 5 | 11 | 15 | |||
14 | 16 | 17 | 15 | 13 | 19 | 14 | 16 | 14 | 17 | 14 | 15 | |||
9 | 10 | 9 | 10 | 9 | 20 | 9 | 10 | 9 | 9 | 9 | 10 | |||
2 | 6 | 3 | 15 | 1 | 9 | 2 | 6 | 2 | 3 | 2 | 15 | |||
6 | 18 | 20 | 15 | 14 | 15 | 6 | 18 | 6 | 20 | 6 | 15 | |||
10 | 14 | 8 | 2 | 11 | 20 | 10 | 14 | 10 | 8 | 10 | 2 | |||
15 | 1 | 15 | 8 | 19 | 11 | 15 | 1 | 15 | 15 | 15 | 8 | |||
16 | 5 | 12 | 17 | 20 | 11 | 16 | 5 | 16 | 12 | 16 | 17 | |||
18 | 10 | 13 | 7 | 3 | 8 | 18 | 10 | 18 | 13 | 18 | 7 | |||
15 | 17 | 9 | 6 | 6 | 18 | 15 | 17 | 15 | 9 | 15 | 6 | |||
14 | 15 | 3 | 14 | 14 | 9 | 14 | 15 | 14 | 3 | 14 | 14 | |||
10 | 8 | 15 | 14 | 10 | 7 | 10 | 8 | 10 | 15 | 10 | 14 | |||
15 | 7 | 18 | 19 | 9 | 1 | 15 | 7 | 15 | 18 | 15 | 19 | |||
19 | 7 | 14 | 2 | 7 | 10 | 19 | 7 | 19 | 14 | 19 | 2 |
<tbody>
</tbody>
The issue is that the amount of columns is dynamic. So sometimes its 10, sometimes 15 and it can run up to 20. I am currently struggling to get it done with a double column loop, but I think I am thinking in the wrong direction.
Is there anyone who can give me a push in the right direction ?
Thanks in advance,
Koen