VBA random number generator.

motilulla

Well-known Member
Joined
Feb 13, 2008
Messages
2,362
Office Version
  1. 2010
Using Excel 2010
Hello,

I need help it is bit tricky random number generator…

Step1-I want first VBA create a list of numbers 1 to 54 in the range C6:C59.

Step2-Pick 1 random numbers out of list range C6:C59 and list it in cell D6.

Step3-Delete picked random from the list C6:C59 and shift up.

Step-4 repeat the Step-2 and place 2nd random below the Cell D6..and continue till find 20 random numbers…

Here below is the example sheet…showing remaining numbers in column C, 20 random in Column D, also check 54 list result in Column G.

Excel Questions.xlsm
ABCDEFGH
1
2
3
4Pick
5Numbers List 20 RandomFull ListCount
62111
73521
84631
971041
1081251
1191561
12112071
13132281
14142891
151636101
161738111
171839121
181941131
192144141
202346151
212447161
222550171
232651181
242752191
252954201
2630211
2731221
2832231
2933241
3034251
3135261
3237271
3340281
3442291
3543301
3645311
3748321
3849331
3953341
40351
41361
42371
43381
44391
45401
46411
47421
48431
49441
50451
51461
52471
53481
54491
55501
56511
57521
58531
59541
60
61
Sheet0
Cell Formulas
RangeFormula
G6:G59G6=COUNTIF(C$6:D$59,F6)


Regards,
Moti
 
Nice to hear we were able to help and thanks for the feedback!

Good day!
 
Upvote 0

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.

Forum statistics

Threads
1,215,096
Messages
6,123,074
Members
449,093
Latest member
ripvw

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