I need to choose 20 randoms numbers from 1-30 and put them in a string joined by ",". I'm using the code:
Problem is I can't have duplicates... anyone know the fix?
Code:
Dim x, y
x = 1
y = ""
Do Until x = 31
y = y & Int((30 - 1 + 1) * Rnd + 1) & ","
x = x + 1
Loop
y = Left(y, Len(y) - 1)
[green]'example result[/green]
22,17,18,9,10,24,1,23,25,22,2,13,26,24,12,29,27,2,29,11,16,24,2,18,15,9,19,20,8,11
Problem is I can't have duplicates... anyone know the fix?