Muhammad Hussaan
New Member
- Joined
- Dec 13, 2017
- Messages
- 49
- Office Version
- 2013
- Platform
- Windows
Hello,
I need help for a VBA code that generates all possible patterns (without duplication) of numbers with following constraints.
Sum should be less than or equal to 177
Sum should be greater than or equal to 174
Number can be repeated (Example: as in pattern 1 number 60 is two time, 64 is two times in pattern 2)
Numbers should not be greater than 5
All patterns should be unique/non repeating
Currently i am doing this manually and very time taking.
Find screenshot of the excel file, For these 20 number i am able to generate 28 patterns keeping all constraint. Although i have checked but might be i have missed few more possibilities.
For pattern generation i use following sheet by entering and check sum product in column V.
I need help for a VBA code that generates all possible patterns (without duplication) of numbers with following constraints.
Sum should be less than or equal to 177
Sum should be greater than or equal to 174
Number can be repeated (Example: as in pattern 1 number 60 is two time, 64 is two times in pattern 2)
Numbers should not be greater than 5
All patterns should be unique/non repeating
Currently i am doing this manually and very time taking.
Find screenshot of the excel file, For these 20 number i am able to generate 28 patterns keeping all constraint. Although i have checked but might be i have missed few more possibilities.
For pattern generation i use following sheet by entering and check sum product in column V.