Sub MacroName() Dim CellValue As Integer CellValue = ActiveCell.Value If CellValue > 20 Then With Selection.Font .Color = -16776961 End With Else With Selection.Font .ThemeColor = xlThemeColorLight2 ' .TintAndShade = 0 End With End If End Sub Sub Test() On Error GoTo Errors1 Dim x As Integer Dim a As Integer Dim c As Double x = 20 a = 0 c = x / a MsgBox ("Опаньки !!!") GoTo Ends: Errors1: MsgBox ("Ну ты блин Тикурила Даещь") Resume Next Ends: End Sub Sub Test() On Error GoTo Error1 Dim x As Integer Dim a As Integer Dim c As Double x = 20 a = Str(InputBox("введите число")) c = x / a x = 10 MsgBox ("Опаньки !!!") GoTo Ends: Error1: MsgBox ("думай о программировании, а не о женщинах") a = Str(InputBox("введите число")) Resume 0 Ends: End Sub