
Sub Macro1()
Dim i As Integer
Dim NumeroCasuale As Integer
For i = 1 To 5
Randomize
NumeroCasuale = Int((2000 - 1000 + 1) * Rnd + 1000)
Range("a" & i).Value = NumeroCasuale
Next i
End Sub
|
Public Sub r()
Dim n As Integer
Dim c As Integer
Dim a As Long
n = InputBox("valore")
Range("a:a").Clear
For a = 1 To n
c = Int((2000 - 1000 + 1) * Rnd + 1000)
Cells(a, 1) = c
Next
End Sub |
