Option Explicit
Sub RandomNumber()
Dim Lowest As Long
Dim Highest As Long
Dim x As Long
Dim y As Long
Dim Total As Long
Dim ChoiceTemp As Long
Dim Choice() As Long
Dim Repeat As Boolean
Application.ScreenUpdating = False
Lowest = 1
Highest = InputBox("what is the highest number?")
Total = InputBox("How many combinations do you want")
ReDim Choice(1 To Total)
For x = 1 To Total
a:
Randomize
Repeat = False
ChoiceTemp = Int((Highest + 1 - Lowest) * Rnd + Lowest)
For y = 1 To Total
If Choice(y) = ChoiceTemp Then
Repeat = True
Else
End If
Next y
If Repeat = True Then
GoTo a:
Else
Choice(x) = ChoiceTemp
End If
Next x
For x = 1 To Total
Sheets("Sheet1").Range("A" & x).Value = Choice(x)
Next
End Sub