Sub
random_number()
Dim
Default
(9)
As
Integer
Dim
i
As
Integer
For
i = 1
To
6561
Randomize
Sheets(
"combinations4"
).Cells(i, 1) = Math.Round(Int((100 - 20 + 1) * Rnd + 20) / 10) * 10
Sheets(
"combinations4"
).Cells(i, 2) = Math.Round(Int((100 - 20 + 1) * Rnd + 20) / 10) * 10
Sheets(
"combinations4"
).Cells(i, 3) = Math.Round(Int((100 - 20 + 1) * Rnd + 20) / 10) * 10
Sheets(
"combinations4"
).Cells(i, 4) = Math.Round(Int((100 - 20 + 1) * Rnd + 20) / 10) * 10
Next
i
If
Sheets(
"combinations4"
).Cells(i, 5).Value > 100
Then
Do
Randomize
Sheets(
"combinations4"
).Cells(i, 1) = Math.Round(Int((100 - 20 + 1) * Rnd + 20) / 10) * 10
Sheets(
"combinations4"
).Cells(i, 2) = Math.Round(Int((100 - 20 + 1) * Rnd + 20) / 10) * 10
Sheets(
"combinations4"
).Cells(i, 3) = Math.Round(Int((100 - 20 + 1) * Rnd + 20) / 10) * 10
Sheets(
"combinations4"
).Cells(i, 4) = Math.Round(Int((100 - 20 + 1) * Rnd + 20) / 10) * 10
Loop
While
Sheets(
"combinations4"
).Cells(1, 5).Value = 100
Else
End
If
End
Sub