Sub longT() t = Timer On Error GoTo CancelHandler Application.EnableCancelKey = xlErrorHandler For i = 1 To 200000 Range("A1") = i * i / i * (10 / 2) + 7 Next i CancelHandler: Application.EnableCancelKey = xlInterrupt If Err.Number = 18 Then MsgBox "Вы нажали кнопку ESC или CTRL + BREAK" t = Timer - t Range("A2") = "Затрачено времени: " & Format(t / 60, "0.00") & "мин." End Sub