Public Sub rnd100() 'random extract 100 unique number bwteen 1 to 1000.
Dim t(1 To 100) As Integer
Dim cnt As Integer, tmp As Integer, I As Integer
Dim flag As Boolean
tmp = Round(Rnd() * 1000, 0)
t(1) = tmp
Cells(1, 1) = tmp
cnt = cnt + 1
While cnt <= 100
flag = True
tmp = Round(Rnd() * 1000, 0)
For I = 1 To cnt
If tmp = t(I) Then flag = False
Next I
If flag = True Then
t(cnt) = tmp
Cells(cnt, 1) = tmp
cnt = cnt + 1
End If
Wend
End Sub