Hello I just made this as I was also intruiged on how to do this, not the
best way to do it no doubt but uses a bucket search and displays them in
order.
Sub randomCol()
Dim bucket() As Boolean
Dim whichCol As String
Dim rndArray() As Integer
Dim howManyRows As Integer
Dim j As Integer
Dim i As Integer
rollSize = 100 'Go up to
howManyRows = 10 'How many different numbers you want along with how
many rows to go down
ReDim bucket(1 To rollSize)
For i = 1 To howManyRows
If bucket(reroll(rollSize)) = False Then
bucket(reroll(rollSize)) = True
Else
i = i - 1
End If
Next i
j = 1
For i = 1 To UBound(bucket)
If bucket(i) = True Then
Sheets("Sheet1").Cells(j, 1).Value = i
j = j + 1
End If
Next i
End Sub
Private Function reroll(rollSize) As Integer
Randomize
reroll = Int((Rnd * rollSize) + 1)
End Function
One of the problems is you can end up with a huge ass array if you wish lots
of random numbers.
Hope this helps!