Sub Iter()
Dim s As Double, pi As Double, e As Double, a As Double
Dim i As Long, znak As Integer, k As Long
e = InputBox("введите значение eps")
pi = 4 * Atn(1)
s = pi
i = 2
znak = 1
k = 0
a = Tan(pi / (2 * i))
Do While a >= e
s = s + znak * a
i = i + 1
a = Tan(pi / (2 * i))
znak = -znak
k = k + 1
Loop
MsgBox "Сумма равна " + Str(s) + ", количество слагаемых " + Str(k)
End Sub