Randomize from set of values
Joel, Mike H, r, howard31,
Thank you all for your contributions.
Joel, Mike H, r - all worked fine for me.
r - your 1st suggestion worked just as well as the 2nd. I saw the difference:
"CreateRandomC = CreateRandomC & v(Int((UBound(v) + 1) * Rnd)) "
I just don't see why you changed it?
Thanks to All.
Amazing response time, by all of you.
Cheers,
Bam.
"Joel" wrote:
How do you prevent duplicates?
"Howard31" wrote:
The easiest way to do it is to put your values into column 1, in each
corresponding cell in column 2 enter the RAND function, than sort the rows
by column 2, which will mix up column1 you can simply chose the first 3
values, recalculate the sheet which will give you new random values in
column2 than resort, do it for the letters and numbers separately.
"Bam" wrote in message
...
Hi All,
I was given a task of making a unique set of random (72 x 6 digit)
alphanumeric from the following available letters & numbers.
C F G H J K M N P Q R S T W X Y Z
2 4 5 6 7 9
The format is to be like this CFG245.
All 72 Values must be unique.
They must all be 3 alpha & 3 numeric, in that order.
I had a look at zrandom, but couldn't see it doing this task for me.
Has anyone the ability to code something like this in vba?
Or is this simply beyond excel's capabilities??
Any assistance would be much appreciated.
Cheers,
Bam.
|