
Sub Genera() Dim Numero, nrtent As Integer nrtent = 0 Cells(1, 1) = "Numero" Cells(2, 1) = "Numero tentativi" Do Numero = Int(Rnd * 100 + 1) nrtent = nrtent + 1 Loop Until Numero > 80 Cells(1, 2) = Numero Cells(2, 2) = nrtent End Sub |
Sub Genera()
Dim Numero, nrtent, c As Integer
Range("B3:CC3").ClearContents
c = 2
nrtent = 0
Cells(1, 1) = "Numero"
Cells(2, 1) = "Numero tentativi"
Cells(3, 1) = "Numeri estratti"
Do
Numero = Int(Rnd * 100 + 1)
nrtent = nrtent + 1
Cells(3, c) = Numero
c = c + 1
Loop Until Numero > 80
Cells(1, 2) = Numero
Cells(2, 2) = nrtent
End Sub
|
