I have the following piece of code for generating 6 random numbers between 1-49. How do I need to adapt this in order to have the number of random no.s, and the range ie 1-1000 to pick from as variables.....?
Sub Resample()
Dim i As Long
Dim hold(49) As Single, Hold2(49) As Single
Randomize
For i = 1 To 49
Hold2(i) = i
Next i
For jj = 1 To iteration
For i = 1 To 49
hold(i) = Rnd
Next i
Call DoubleSort(49, hold, Hold2)
For i = 1 To 6
Cells(jj + 3, i) = Hold2(i)
Next i
Next jj
End Sub
Thanks.
Sub Resample()
Dim i As Long
Dim hold(49) As Single, Hold2(49) As Single
Randomize
For i = 1 To 49
Hold2(i) = i
Next i
For jj = 1 To iteration
For i = 1 To 49
hold(i) = Rnd
Next i
Call DoubleSort(49, hold, Hold2)
For i = 1 To 6
Cells(jj + 3, i) = Hold2(i)
Next i
Next jj
End Sub
Thanks.