View Single Post
 
Old 09-27-2017, 05:21 PM
dwrowe001 dwrowe001 is offline
Newcomer
 
Join Date: Sep 2017
Posts: 1
Default Lotto Permutations, Combinations

Hi,
Newbee to site needing help with coming up with code to generate numbers
for lotto picks...

I know nothing about VB, but I do know I need it to accomplish my needs. So I need help.

I have created a workbook in Excel 2016, with all the past draws for 5/60 lotto. 5 numbers picked out of 1 to 60.

I have formulas (I've gotten help with those also... sigh) which narrow down possible numbers for future draw.. and puts them in list which I have in on a worksheet named POOLS, in Column C, C2 down to C?? this list varies in length between 20 to 40 numbers, it just depends... and the numbers are random, not sequential.
example:

C
numbers
03
07
08
10
12
17
19
23
25
28
31
33
42
45
48
51
60

I would like help with coming up with code which would generate all possible combos from that list. I would like to have the ability to control how many are generated, like generate only 5, 10, 20 30 etc... what ever I put in.

Also I would like to be able to have a sum range, min and max sum range of the generated picks. Example if I put in Min: 100 Max: 125, only numbers within that range will be generated.

Lastly I would like the ability of entering static numbers in any of the 5 positions.. have 5 boxes(cells) for balls 1, 2,3,4,5. If I put a 5 in the first box, for ball 1, then all the generated numbers would start with 5.. If I put a 2 in position 1 and 55 in last position, then all generated numbers would start with 2 and end with 55.

I hope I haven't gone to far with my request?? I know that there are possibly other posts which address my needs, but as I said, I know absolutely nothing about VB coding and wouldn't know what the heck I was looking at or how to modify it to meet my specific needs. I would be eternally grateful to anyone who helps... Thank you!!!

Dave
Reply With Quote