Требуемая процедура
Sub ex1(ByRef a() As Integer, ByRef nn As Integer, ByRef nz As Integer)
Dim i As Integer
nn = 0: nz = 0
For i = 1 To 45
If a(i) = 0 Then
nz = nz + 1
Else
If a(i) < 0 And i <= 35 Then<br> nn = nn + 1
End If
End If
Next i
End Sub
Процедура для тестирования с выводом на лист Excel
Sub Test()
Dim p(1 To 45) As Integer
Dim n1 As Integer, n2 As Integer, i As Integer
Randomize Timer
For i = 1 To 45
p(i) = Int(25 * Rnd - 12)
Cells(i, 1) = p(i)
Next i
ex1 p, n1, n2
Cells(1, 2) = n1
Cells(1, 3) = n2
End Sub