Hi

I'm new to the macro/vba thing and need to do a job random selecting 267 numbers with no duplicates i 5 to 10 ranges of numbers, and with different weight according to the selected group, like:

Group 1:
1-108, 217-324, 433-540, 649-756, 865-972, 973-1080

Group 2:
1-108, 217-324, 433-540, 649-756, 865-972, 973-1080, 325-432

Group 3:
1-108, 217-324, 433-540, 649-756, 865-972, 973-1080, 325-432, 109-216

Group 4:
1-108, 217-324, 433-540, 649-756, 865-972, 973-1080, 325-432, 109-216, 541-648, 757-864
(1-972)

The weight is controlled by the choice of Group:

When Group 1. is selected, then as written above, the primary selection of random numbers comes from the number-ranges of Group 1 - then a selection of 3 numbers from the next two ranges added in Group 2 is needed, and then 3 numbers from added numbers in Group 3, and 2 numbers from added numbers in Group 4, and last 4 numbers from the 10th number-range like this:

Group 1 selected:
2 random numbers from each two number-ranges added to Group 4 - 541-648, 757-864
3 random numbers from the number-ranges added to Group 3 - 109-216
3 random numbers from the number-ranges added to Group 2 - 325-432
4 random numbers from the new added number-ranges added - 973-1080
And the rest from Group 1 number-ranges, leaving 253 random numbers to be selected from there, divided - 50, 50, 50, 50, 53 in the five number-ranges

Group 2 selected:
4 random numbers from each two number-ranges added to Group 4 - 541-648, 757-864
6 random numbers from the number-ranges added to Group 3 - 109-216
6 random numbers from the number-ranges added to Group 2 - 325-432
6 random numbers from the new added number-ranges added - 973-1080
And the rest from Group 1 number-ranges, leaving 241 random numbers to be selected from there, divided - 48, 48, 48, 48, 49 in the five number-ranges

Group 3 selected:
8 random numbers from each two number-ranges added to Group 4 - 541-648, 757-864
10 random numbers from the number-ranges added to Group 3 - 109-216
10 random numbers from the number-ranges added to Group 2 - 325-432
10 random numbers from the new added number-ranges added - 973-1080
And the rest from Group 1 number-ranges, leaving 221 random numbers to be selected from there, divided - 44, 44, 44, 44, 45 in the five number-ranges

Group 4 selected:
40 random numbers from each two number-ranges added to Group 4 - 541-648, 757-864
35 random numbers from the number-ranges added to Group 3 - 109-216
35 random numbers from the number-ranges added to Group 2 - 325-432
20 random numbers from the new added number-ranges added - 973-1080
And the rest from Group 1 number-ranges, leaving 97 random numbers to be selected from there, divided - 19, 19, 19, 19, 21 in the five number-ranges

And one last question, is it possible to put the numbers i rows, one in each instead of in columns ??

All the best
Carsten