I want to make sure that the random values I create are unique. So this is the code I use....
The problem is that I need to create a lot of values and that means that my code will contain a huge number of If statements. So is there a more efficient way of doing this? Thanks.
Code:
Do
For x = 1 To 3
thevalue(x) = Int((10 - 1 + 1) * Rnd + 1)
Next x
If thevalue(1) <> thevalue(2) Then
If thevalue(1) <> thevalue(3) Then
If thevalue(2) <> thevalue(3) Then
Exit Do
End If
End If
End If
Loop