montecarlo2012
Well-known Member
- Joined
- Jan 26, 2011
- Messages
- 984
- Office Version
- 2010
- Platform
- Windows
how is possible to generate a list of numbers from 20 taken 6 at the time, this 20 numbers are taking from 1 to 53,
how can I control the sum, the range and the even and odds. I mean, if I want all list with sum iqual 200, range 40 and 5 odds/ 1 even for example (of course I want to input all this values), sombebody think is possible a vba code excel 2003. (note: range is substract 50-9 example here. ), ascending order from the left to the right. userform and excecutable file would be appreciate.
Code:
<TABLE style="WIDTH: 528pt; BORDER-COLLAPSE: collapse" border=0 cellSpacing=0 cellPadding=0 width=704 x:str><COLGROUP><COL style="WIDTH: 48pt" span=11 width=64><TBODY><TR style="HEIGHT: 14.25pt" height=19><TD style="BORDER-BOTTOM: windowtext 1.5pt solid; BORDER-LEFT: windowtext 1.5pt solid; BACKGROUND-COLOR: transparent; WIDTH: 48pt; HEIGHT: 14.25pt; BORDER-TOP: windowtext 1.5pt solid; BORDER-RIGHT: windowtext 1.5pt solid" class=xl65 height=19 width=64></TD><TD style="BORDER-BOTTOM: windowtext 1.5pt solid; BORDER-LEFT: windowtext; BACKGROUND-COLOR: transparent; WIDTH: 48pt; BORDER-TOP: windowtext 1.5pt solid; BORDER-RIGHT: windowtext 1.5pt solid" class=xl65 width=64></TD><TD style="BORDER-BOTTOM: windowtext 1.5pt solid; BORDER-LEFT: windowtext; BACKGROUND-COLOR: transparent; WIDTH: 48pt; BORDER-TOP: windowtext 1.5pt solid; BORDER-RIGHT: windowtext 1.5pt solid" class=xl65 width=64></TD><TD style="BORDER-BOTTOM: windowtext 1.5pt solid; BORDER-LEFT: windowtext; BACKGROUND-COLOR: transparent; WIDTH: 48pt; BORDER-TOP: windowtext 1.5pt solid; BORDER-RIGHT: windowtext 1.5pt solid" class=xl65 width=64></TD><TD style="BORDER-BOTTOM: windowtext 1.5pt solid; BORDER-LEFT: windowtext; BACKGROUND-COLOR: transparent; WIDTH: 48pt; BORDER-TOP: windowtext 1.5pt solid; BORDER-RIGHT: windowtext 1.5pt solid" class=xl65 width=64></TD><TD style="BORDER-BOTTOM: windowtext 1.5pt solid; BORDER-LEFT: windowtext; BACKGROUND-COLOR: transparent; WIDTH: 48pt; BORDER-TOP: windowtext 1.5pt solid; BORDER-RIGHT: windowtext 1.5pt solid" class=xl65 width=64></TD><TD style="BORDER-BOTTOM: windowtext 1.5pt solid; BORDER-LEFT: windowtext; BACKGROUND-COLOR: transparent; WIDTH: 48pt; BORDER-TOP: windowtext 1.5pt solid; BORDER-RIGHT: windowtext 1.5pt solid" class=xl65 width=64></TD><TD style="BORDER-BOTTOM: windowtext 1.5pt solid; BORDER-LEFT: windowtext; BACKGROUND-COLOR: transparent; WIDTH: 48pt; BORDER-TOP: windowtext 1.5pt solid; BORDER-RIGHT: windowtext 1.5pt solid" class=xl65 width=64>[FONT=Arial][SIZE=2]sum[/SIZE][/FONT]</TD><TD style="BORDER-BOTTOM: windowtext 1.5pt solid; BORDER-LEFT: windowtext; BACKGROUND-COLOR: transparent; WIDTH: 48pt; BORDER-TOP: windowtext 1.5pt solid; BORDER-RIGHT: windowtext 1.5pt solid" class=xl65 width=64>[FONT=Arial][SIZE=2]range[/SIZE][/FONT]</TD><TD style="BORDER-BOTTOM: windowtext 1.5pt solid; BORDER-LEFT: windowtext; BACKGROUND-COLOR: transparent; WIDTH: 48pt; BORDER-TOP: windowtext 1.5pt solid; BORDER-RIGHT: windowtext 1.5pt solid" class=xl65 width=64>[FONT=Arial][SIZE=2]evens[/SIZE][/FONT]</TD><TD style="BORDER-BOTTOM: windowtext 1.5pt solid; BORDER-LEFT: windowtext; BACKGROUND-COLOR: transparent; WIDTH: 48pt; BORDER-TOP: windowtext 1.5pt solid; BORDER-RIGHT: windowtext 1.5pt solid" class=xl65 width=64>[FONT=Arial][SIZE=2]odds[/SIZE][/FONT]</TD></TR><TR style="HEIGHT: 14.25pt" height=19><TD style="BORDER-BOTTOM: windowtext 1.5pt solid; BORDER-LEFT: windowtext 1.5pt solid; BACKGROUND-COLOR: transparent; HEIGHT: 14.25pt; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 1.5pt solid" class=xl65 height=19 align=right x:num>[FONT=Arial][SIZE=2]9[/SIZE][/FONT]</TD><TD style="BORDER-BOTTOM: windowtext 1.5pt solid; BORDER-LEFT: windowtext; BACKGROUND-COLOR: transparent; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 1.5pt solid" class=xl65 align=right x:num>[FONT=Arial][SIZE=2]12[/SIZE][/FONT]</TD><TD style="BORDER-BOTTOM: windowtext 1.5pt solid; BORDER-LEFT: windowtext; BACKGROUND-COLOR: transparent; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 1.5pt solid" class=xl65 align=right x:num>[FONT=Arial][SIZE=2]17[/SIZE][/FONT]</TD><TD style="BORDER-BOTTOM: windowtext 1.5pt solid; BORDER-LEFT: windowtext; BACKGROUND-COLOR: transparent; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 1.5pt solid" class=xl65 align=right x:num>[FONT=Arial][SIZE=2]29[/SIZE][/FONT]</TD><TD style="BORDER-BOTTOM: windowtext 1.5pt solid; BORDER-LEFT: windowtext; BACKGROUND-COLOR: transparent; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 1.5pt solid" class=xl65 align=right x:num>[FONT=Arial][SIZE=2]35[/SIZE][/FONT]</TD><TD style="BORDER-BOTTOM: windowtext 1.5pt solid; BORDER-LEFT: windowtext; BACKGROUND-COLOR: transparent; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 1.5pt solid" class=xl65 align=right x:num>[FONT=Arial][SIZE=2]50[/SIZE][/FONT]</TD><TD style="BORDER-BOTTOM: windowtext 1.5pt solid; BORDER-LEFT: windowtext; BACKGROUND-COLOR: transparent; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 1.5pt solid" class=xl65></TD><TD style="BORDER-BOTTOM: windowtext 1.5pt solid; BORDER-LEFT: windowtext; BACKGROUND-COLOR: transparent; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 1.5pt solid" class=xl65 align=right x:num x:fmla="=SUM(A2:F2)">[FONT=Arial][SIZE=2]152[/SIZE][/FONT]</TD><TD style="BORDER-BOTTOM: windowtext 1.5pt solid; BORDER-LEFT: windowtext; BACKGROUND-COLOR: transparent; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 1.5pt solid" class=xl65 align=right x:num x:fmla="=F2-A2">[FONT=Arial][SIZE=2]41[/SIZE][/FONT]</TD><TD style="BORDER-BOTTOM: windowtext 1.5pt solid; BORDER-LEFT: windowtext; BACKGROUND-COLOR: transparent; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 1.5pt solid" class=xl65 align=right x:num>[FONT=Arial][SIZE=2]2[/SIZE][/FONT]</TD><TD style="BORDER-BOTTOM: windowtext 1.5pt solid; BORDER-LEFT: windowtext; BACKGROUND-COLOR: transparent; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 1.5pt solid" class=xl65 align=right x:num>[FONT=Arial][SIZE=2]4[/SIZE][/FONT]</TD></TR><TR style="HEIGHT: 14.25pt" height=19><TD style="BORDER-BOTTOM: windowtext 1.5pt solid; BORDER-LEFT: windowtext 1.5pt solid; BACKGROUND-COLOR: transparent; HEIGHT: 14.25pt; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 1.5pt solid" class=xl65 height=19 align=right x:num>[FONT=Arial][SIZE=2]11[/SIZE][/FONT]</TD><TD style="BORDER-BOTTOM: windowtext 1.5pt solid; BORDER-LEFT: windowtext; BACKGROUND-COLOR: transparent; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 1.5pt solid" class=xl65 align=right x:num>[FONT=Arial][SIZE=2]26[/SIZE][/FONT]</TD><TD style="BORDER-BOTTOM: windowtext 1.5pt solid; BORDER-LEFT: windowtext; BACKGROUND-COLOR: transparent; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 1.5pt solid" class=xl65 align=right x:num>[FONT=Arial][SIZE=2]36[/SIZE][/FONT]</TD><TD style="BORDER-BOTTOM: windowtext 1.5pt solid; BORDER-LEFT: windowtext; BACKGROUND-COLOR: transparent; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 1.5pt solid" class=xl65 align=right x:num>[FONT=Arial][SIZE=2]45[/SIZE][/FONT]</TD><TD style="BORDER-BOTTOM: windowtext 1.5pt solid; BORDER-LEFT: windowtext; BACKGROUND-COLOR: transparent; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 1.5pt solid" class=xl65 align=right x:num>[FONT=Arial][SIZE=2]46[/SIZE][/FONT]</TD><TD style="BORDER-BOTTOM: windowtext 1.5pt solid; BORDER-LEFT: windowtext; BACKGROUND-COLOR: transparent; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 1.5pt solid" class=xl65 align=right x:num>[FONT=Arial][SIZE=2]52[/SIZE][/FONT]</TD><TD style="BORDER-BOTTOM: windowtext 1.5pt solid; BORDER-LEFT: windowtext; BACKGROUND-COLOR: transparent; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 1.5pt solid" class=xl65></TD><TD style="BORDER-BOTTOM: windowtext 1.5pt solid; BORDER-LEFT: windowtext; BACKGROUND-COLOR: transparent; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 1.5pt solid" class=xl65 align=right x:num x:fmla="=SUM(A3:F3)">[FONT=Arial][SIZE=2]216[/SIZE][/FONT]</TD><TD style="BORDER-BOTTOM: windowtext 1.5pt solid; BORDER-LEFT: windowtext; BACKGROUND-COLOR: transparent; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 1.5pt solid" class=xl65 align=right x:num x:fmla="=F3-A3">[FONT=Arial][SIZE=2]41[/SIZE][/FONT]</TD><TD style="BORDER-BOTTOM: windowtext 1.5pt solid; BORDER-LEFT: windowtext; BACKGROUND-COLOR: transparent; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 1.5pt solid" class=xl65 align=right x:num>[FONT=Arial][SIZE=2]4[/SIZE][/FONT]</TD><TD style="BORDER-BOTTOM: windowtext 1.5pt solid; BORDER-LEFT: windowtext; BACKGROUND-COLOR: transparent; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 1.5pt solid" class=xl65 align=right x:num>[FONT=Arial][SIZE=2]2[/SIZE][/FONT]</TD></TR><TR style="HEIGHT: 14.25pt" height=19><TD style="BORDER-BOTTOM: windowtext 1.5pt solid; BORDER-LEFT: windowtext 1.5pt solid; BACKGROUND-COLOR: transparent; HEIGHT: 14.25pt; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 1.5pt solid" class=xl65 height=19 align=right x:num>[FONT=Arial][SIZE=2]1[/SIZE][/FONT]</TD><TD style="BORDER-BOTTOM: windowtext 1.5pt solid; BORDER-LEFT: windowtext; BACKGROUND-COLOR: transparent; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 1.5pt solid" class=xl65 align=right x:num>[FONT=Arial][SIZE=2]12[/SIZE][/FONT]</TD><TD style="BORDER-BOTTOM: windowtext 1.5pt solid; BORDER-LEFT: windowtext; BACKGROUND-COLOR: transparent; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 1.5pt solid" class=xl65 align=right x:num>[FONT=Arial][SIZE=2]25[/SIZE][/FONT]</TD><TD style="BORDER-BOTTOM: windowtext 1.5pt solid; BORDER-LEFT: windowtext; BACKGROUND-COLOR: transparent; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 1.5pt solid" class=xl65 align=right x:num>[FONT=Arial][SIZE=2]33[/SIZE][/FONT]</TD><TD style="BORDER-BOTTOM: windowtext 1.5pt solid; BORDER-LEFT: windowtext; BACKGROUND-COLOR: transparent; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 1.5pt solid" class=xl65 align=right x:num>[FONT=Arial][SIZE=2]35[/SIZE][/FONT]</TD><TD style="BORDER-BOTTOM: windowtext 1.5pt solid; BORDER-LEFT: windowtext; BACKGROUND-COLOR: transparent; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 1.5pt solid" class=xl65 align=right x:num>[FONT=Arial][SIZE=2]42[/SIZE][/FONT]</TD><TD style="BORDER-BOTTOM: windowtext 1.5pt solid; BORDER-LEFT: windowtext; BACKGROUND-COLOR: transparent; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 1.5pt solid" class=xl65></TD><TD style="BORDER-BOTTOM: windowtext 1.5pt solid; BORDER-LEFT: windowtext; BACKGROUND-COLOR: transparent; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 1.5pt solid" class=xl65 align=right x:num x:fmla="=SUM(A4:F4)">[FONT=Arial][SIZE=2]148[/SIZE][/FONT]</TD><TD style="BORDER-BOTTOM: windowtext 1.5pt solid; BORDER-LEFT: windowtext; BACKGROUND-COLOR: transparent; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 1.5pt solid" class=xl65 align=right x:num x:fmla="=F4-A4">[FONT=Arial][SIZE=2]41[/SIZE][/FONT]</TD><TD style="BORDER-BOTTOM: windowtext 1.5pt solid; BORDER-LEFT: windowtext; BACKGROUND-COLOR: transparent; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 1.5pt solid" class=xl65 align=right x:num>[FONT=Arial][SIZE=2]2[/SIZE][/FONT]</TD><TD style="BORDER-BOTTOM: windowtext 1.5pt solid; BORDER-LEFT: windowtext; BACKGROUND-COLOR: transparent; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 1.5pt solid" class=xl65 align=right x:num>[FONT=Arial][SIZE=2]4[/SIZE][/FONT]</TD></TR></TBODY></TABLE>
how can I control the sum, the range and the even and odds. I mean, if I want all list with sum iqual 200, range 40 and 5 odds/ 1 even for example (of course I want to input all this values), sombebody think is possible a vba code excel 2003. (note: range is substract 50-9 example here. ), ascending order from the left to the right. userform and excecutable file would be appreciate.
Last edited: