Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Good afternoon,
I found this while doing a search. It works fine, but how can I adapt it to take the number of balls drawn which is in cell H3, the number of balls drawn from which is in cell I3 and the number of combinations I want to randomly produce which is in cell J3. These three cells are in a worksheet called ‘Random Numbers’. Sub lottery() Dim my(1 To 49) For j = 1 To 10 ' Reinit array before selecting For I = 1 To 49 my(I) = I Next I For k = 1 To 6 Randomize NewNumber: Number = Int(49 * Rnd) + 1 If my(Number) = "" Then GoTo NewNumber Else Cells(j, k) = my(Number) my(Number) = "" End If Next k Next j End Sub Thanks in advance, Paul |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Pickup the content of Cells ( in formula) | Excel Worksheet Functions | |||
To delete paired numbers or pickup last cell for each item | Excel Discussion (Misc queries) | |||
pickup the amount from the workbook | Excel Programming | |||
Vlookup (pickup the last row... | Excel Worksheet Functions | |||
excel won't pickup an Access query for a pivot table | Excel Programming |