Sub bassket()
N = 30
Dim A(30) As Integer
Dim i, x, y As Integer
Dim s As Variant
For i = 1 To N
A(i) = Int(40 * Rnd() + 160)
Cells(i, 2) = i
Cells(i, 3) = A(i)
Cells(i, 4) = "Не годен, рост меньше 180 см"
If A(i) < 180 Then
Else
Cells(i, 4) = "Баскетболист"
s = s + 1
End If
Next i
Cells(i, 3) = "Всего ="
Cells(i, 4) = s
End Sub
Скачать вложение Excel (XLS)