VBA to run combinations following data that is structured by columns that are labled, need help please!!

Estatefinds

Board Regular
Joined
Sep 14, 2015
Messages
169
DCDDDEDFDGDHDIDJDKDLDMDNDDDPDQDRDSDTDUDVDWDXDYDZEAEBECEDEEEFEGEHEIEJEKGCGDGEGFGGGHGIGJGKGLGMGNGOGPGQGRGSGTGUGVGWGXGYGZHAHBHCHDHEHFHGHHHIHJHK
instructions
are belowRow 1Row 2Row 3Row 4Row 5Row 6Row 7Row 8Row 9Row 10Row 11Row 12Row 13Row 14Row 15Row 16Row 17Row 18Row 19Row 20Row 21Row 22Row 23Row 24Row 25Row 26Row 27Row 28Row 29Row 30Row 31Row 32Row 33Row 34Row 35
this data A1A2A3C4C5A6C7A9A10E11E12B13D14B15A18C22E35
will change >B1B2B3E4E5B6D7C9E14
so macro C1C2C3D6
will work with data changesD1D2D3
E1E2
>1851418413163283010171162023
2191232347252631
9212215
242729
3335
Row 1Row 2Row 3Row 4Row 5Row 6Row 7Row 8Row 9Row 10Row 11Row 12Row 13Row 14Row 15Row 16Row 17Row 18Row 19Row 20Row 21Row 22Row 23Row 24Row 25Row 26Row 27Row 28Row 29Row 30Row 31Row 32Row 33Row 34Row 35Row 1Row 2Row 3Row 4Row 5Row 6Row 7Row 8Row 9Row 10Row 11Row 12Row 13Row 14Row 15Row 16Row 17Row 18Row 19Row 20Row 21Row 22Row 23Row 24Row 25Row 26Row 27Row 28Row 29Row 30Row 31Row 32Row 33Row 34Row 35
1-8-12-14-18comboscomboscomboscomboscombosetc>
1-8-12-14-34
1-8-12-14-15
1-8-12-14-25
1-8-12-14-16
1-8-12-14-26
1-8-12-14-28
1-8-12-14-30
1-8-12-14-17
1-8-12-14-31
1-8-22-25-26
1-8-22-25-28
1-8-22-25-30
1-8-22-25-31
1-8-29-32-34
1-8-29-30-31
1-8-14-18-25
1-8-14-18-26
1-8-14-18-28
1-8-14-18-30
1-8-14-1831
1-8-14-18-20
1-8-14-18-23
1-8-18-25-26
1-8-18-25-28
1-8-18-25-30
1-8-18-25-31
1-8-15-25-26
1-8-15-25-28
1-8-15-25-30
1-8-15-25-31
1-8-15-26-28
1-8-15-26-30
1-8-15-26-31
1-8-15-28-30
1-8-15-28-31
1-8-15-30-31
1-8-15-17-20
1-8-15-17-23
1-8-15-20-23
1-8-13-16-28
1-8-13-16-30
1-8-13-16-17
1-8-13-16-20
1-8-13-16-23
1-8-25-26-28
1-8-25-26-28
dont let the alpha numerics confuse you these are just for my use.
example shows how the numbers follow the rule presented below
these are just a hand ful of results but when the macro runs them all I would like them to be placed on the row 13 of worksheet in the range og GC to HK
the data in te column labled row 1
will continue until no other combinations can be made from left to right then it will go to the next number down in Row 1
which will the the number 2 it will do the same as above and continue untill there are no more combinations to be made left to right.
then it will go to the number and continue until no more combinations can be made left to right
then will go to 24 and continue until no more combinations can be made from left to right
then will continue to 33 and continue until no more combiantions can be made from left to right.
then the process will start over again but this time in the column labeled row 2.
so sonce the numbers in row 1 meaning the 1,2,9,24,33 are the starting point of the combinations the results will be placed in the column below the data lebeled row 1.
then the starting point will be at row 2 to start the process all over again,
the the first combinations will start witht eht first number 8 then it will find all combination in the data from lef to right once those are done it will go ot the next number 19 and continue until all combinations are found , then
it will go down to the next number 21 and continue to find all combnations until no more can be made. And so on.
then once all columns of data labeled rows are done where no more five number combinations can be made , from left to right as seen in the column labled row 1 the five number combinations.
added note: so look at the column labeled row 12 the numbers in this column are 30 this would look from this number to the right for the next number up in the columns to the right to build the combination.
So for example 30 is the first number and looks to the right for more numbers to build a combnation so 31 comes after 30 and there are no more numbers above 31 so a combination cant be made.
now once all the left to right combinations are done I need to have the macro run same idea but this time from right to left and place the combinations in the column labeled row in which the first number is used for example
the column labled row 35 has the number 23 so all the combination would go below that data in to the column labled 35. so from right to left it would start at number 23 and go to the next number in the column labled 14 and use the number 31 and then go to the column labled row and use the number 34
and go to column labled row 2 for the number 35 since there are only four numbers and not five numbers to make a five number combination this is not listed. Only five number combinations are listted. Then it would continue to look for combinations and once cant find any more it will go to the next number 20 in column lanbled row 22 and look for comboination from there and these combonations will be placed in column labled row 22.
so the results of the of the from right to left start in the same column and row label as the left to right just placed the right to left data under last data resulted from the lef to right data.
In column DC the number 1 is at the top of the data in which this will be the first number of a combination of five numbers smallest to great from left to right. So I need a macro to look at the first number
the number 1 for example and look at the columns to the right of the column labled row 1. the macro will then sart with the next number up in value whether it is one up or two or what ever until I has five numbers to make the combination, then it will start another combination doing the dsame thing as seen in the example in the column labeld row 1.

<colgroup><col span="5"><col><col><col span="112"></colgroup><tbody>
</tbody>
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
Could you repost your question in a more readable format?
 
Upvote 0
the data in te column labled row 1
will continue until no other combinations can be made from left to right then it will go to the next number down in Row 1
which will the the number 2 it will do the same as above and continue untill there are no more combinations to be made left to right.
then it will go to the number and continue until no more combinations can be made left to right
then will go to 24 and continue until no more combinations can be made from left to right
then will continue to 33 and continue until no more combiantions can be made from left to right.
then the process will start over again but this time in the column labeled row 2.
so sonce the numbers in row 1 meaning the 1,2,9,24,33 are the starting point of the combinations the results will be placed in the column below the data lebeled row 1.
then the starting point will be at row 2 to start the process all over again,
the the first combinations will start witht eht first number 8 then it will find all combination in the data from lef to right once those are done it will go ot the next number 19 and continue until all combinations are found , then
it will go down to the next number 21 and continue to find all combnations until no more can be made. And so on.
then once all columns of data labeled rows are done where no more five number combinations can be made , from left to right as seen in the column labled row 1 the five number combinations.
added note: so look at the column labeled row 12 the numbers in this column are 30 this would look from this number to the right for the next number up in the columns to the right to build the combination.
So for example 30 is the first number and looks to the right for more numbers to build a combnation so 31 comes after 30 and there are no more numbers above 31 so a combination cant be made.
now once all the left to right combinations are done I need to have the macro run same idea but this time from right to left and place the combinations in the column labeled row in which the first number is used for example
the column labled row 35 has the number 23 so all the combination would go below that data in to the column labled 35. so from right to left it would start at number 23 and go to the next number in the column labled 14 and use the number 31 and then go to the column labled row and use the number 34
and go to column labled row 2 for the number 35 since there are only four numbers and not five numbers to make a five number combination this is not listed. Only five number combinations are listted. Then it would continue to look for combinations and once cant find any more it will go to the next number 20 in column lanbled row 22 and look for comboination from there and these combonations will be placed in column labled row 22.
so the results of the of the from right to left start in the same column and row label as the left to right just placed the right to left data under last data resulted from the lef to right data.
In column DC the number 1 is at the top of the data in which this will be the first number of a combination of five numbers smallest to great from left to right. So I need a macro to look at the first number
the number 1 for example and look at the columns to the right of the column labled row 1. the macro will then sart with the next number up in value whether it is one up or two or what ever until I has five numbers to make the combination, then it will start another combination doing the dsame thing as seen in the example in the column labeld row 1.

<tbody>
</tbody>
 
Upvote 0
DCDDDEDFDGDHDIDJDKDLDMDNDDDPDQDRDSDTDUDVDWDXDYDZEAEBECEDEEEFEGEHEIEJEKGCGDGEGFGGGHGIGJGKGLGMGNGOGPGQGRGSGTGUGVGWGXGYGZHAHBHCHDHEHFHGHHHIHJHK
Row 1Row 2Row 3Row 4Row 5Row 6Row 7Row 8Row 9Row 10Row 11Row 12Row 13Row 14Row 15Row 16Row 17Row 18Row 19Row 20Row 21Row 22Row 23Row 24Row 25Row 26Row 27Row 28Row 29Row 30Row 31Row 32Row 33Row 34Row 35
A1A2A3C4C5A6C7A9A10E11E12B13D14B15A18C22E35
B1B2B3E4E5B6D7C9E14
C1C2C3D6
D1D2D3
E1E2
1851418413163283010171162023
2191232347252631
9212215
242729
3335
Row 1Row 2Row 3Row 4Row 5Row 6Row 7Row 8Row 9Row 10Row 11Row 12Row 13Row 14Row 15Row 16Row 17Row 18Row 19Row 20Row 21Row 22Row 23Row 24Row 25Row 26Row 27Row 28Row 29Row 30Row 31Row 32Row 33Row 34Row 35Row 1Row 2Row 3Row 4Row 5Row 6Row 7Row 8Row 9Row 10Row 11Row 12Row 13Row 14Row 15Row 16Row 17Row 18Row 19Row 20Row 21Row 22Row 23Row 24Row 25Row 26Row 27Row 28Row 29Row 30Row 31Row 32Row 33Row 34Row 35
1-8-12-14-18
1-8-12-14-34
1-8-12-14-15
1-8-12-14-25
1-8-12-14-16
1-8-12-14-26
1-8-12-14-28
1-8-12-14-30
1-8-12-14-17
1-8-12-14-31
1-8-22-25-26
1-8-22-25-28
1-8-22-25-30
1-8-22-25-31
1-8-29-32-34
1-8-29-30-31
1-8-14-18-25
1-8-14-18-26
1-8-14-18-28
1-8-14-18-30
1-8-14-1831
1-8-14-18-20
1-8-14-18-23
1-8-18-25-26
1-8-18-25-28
1-8-18-25-30
1-8-18-25-31
1-8-15-25-26
1-8-15-25-28
1-8-15-25-30
1-8-15-25-31
1-8-15-26-28
1-8-15-26-30
1-8-15-26-31
1-8-15-28-30
1-8-15-28-31
1-8-15-30-31
1-8-15-17-20
1-8-15-17-23
1-8-15-20-23
1-8-13-16-28
1-8-13-16-30
1-8-13-16-17
1-8-13-16-20
1-8-13-16-23
1-8-25-26-28
1-8-25-26-28

<colgroup><col><col><col span="70"></colgroup><tbody>
</tbody>
 
Upvote 0
I don't follow that at all, and can't find a question in your question. Maybe someone else can help.
 
Upvote 0
ok so its making combinations in order from row 1 and taking the numbers that are above the the number say number 1 and then looks to the data pool to the right and and tales the number that is closets to the number 1 as you can see in the list of combinations. if you look at the combinations one at a time you ll see the pattern of what i need the macro to do. let me know if you understand
 
Upvote 0
so i m trying to set up the data for analyzing

so its reading data starting from left to right and the number increases with every number added to the five number combination.
so for example out of a range of data 1,5,10,20,26,32,35 the fist combinations would be 1-5-10-20-26 reading from left to right.
another example 25,12,33,17,18,08 so for this one there would be no combination if i started with 25 ,33, there are no other numbers to build off of the 25 and it runs out of numbers keeping inn mind the number that make up the combinations are 1 through 35.
 
Last edited:
Upvote 0
111
222
333
444
555
666
777
888
999
101010
111111
121212
131313
141414
151515
161616
171717
181818
191919
202020
212121
222222
232323
242424
252525
262626
272727
282828
292929
303030
313131
323232
333333
343434
353535
Row 1Row 2Row 3Row 4Row 5Row 6Row 7Row 8Row 9Row 10Row 11Row 12Row 13Row 14Row 15Row 16Row 17Row 18Row 19Row 20Row 21Row 22Row 23Row 24Row 25Row 26Row 27Row 28Row 29Row 30Row 31Row 32Row 33Row 34Row 35
so this should make it easier to understand for any one that can help me with a macro

<tbody>
</tbody>
so basically it is starting from the first top number in the data in row 1 and moving to the next row 2 and uses number that climbs higher an continues to do so to make a combination so my question is; Is there a macro that can perform this task?
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,232
Messages
6,123,763
Members
449,120
Latest member
Aa2

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top