Dim RanNo() As Long
Dim i, j, tmp
Private Sub RandomizeNumbers(ByVal iFrom As Integer, ByVal iTo As Integer)
ReDim RanNo(iFrom To iTo)
For i = iFrom To iTo
RanNo(i) = i
Next i
Randomize (Timer)
For i = iFrom To iTo
j = CInt((iTo - iFrom) * Rnd + iFrom)
tmp = RanNo(i)
RanNo(i) = RanNo(j)
RanNo(j) = tmp
Next i
End Sub
Private Sub Command1_Click()
RandomizeNumbers 0, 100
For i = 0 To 100
print RanNo(i)
Next i
End Sub