How would one control the random number to only return six unique values?
The code I have been toying with generates duplicate values:
Sub RandomNumbers_6_Unique()
oNo1 = Int((6 * Rnd) +1)
oNo2 = Int((6 * Rnd) +1)
oNo3 = Int((6 * Rnd) +1)
oNo4 = Int((6 * Rnd) +1)
oNo5 = Int((6 * Rnd) +1)
oNo6 = Int((6 * Rnd) +1)
MsgBox oNo1 & "-" & oNo2 & "-" & oNo3 & "-" & oNo4 & "-" & oNo5 & "-" & oNo6
End Sub
This is a test to return only numbers between 1 and 6. Eventually I will expand it and only want 6 unique random numbers returned.
Thanks,
John



