Здравствуйте. Имеется такой код:
И он почему-то зависает. Если один If...Then убрать, то все нормально. Подскажите в чем тут ошибка.
Код |
---|
Private Sub Worksheet_Change(ByVal Target As Range) m = Cells(16, 9).Value c = Cells(8, 9).Value n = m - c If n < 0 Then Cells(12, 9).Value = "Норма" Else Cells(12, 9).Value = Cells(16, 9).Value - Cells(8, 9).Value End If If Cells(8, 9).Value > Cells(6, 9).Value Then Cells(27, 9).Value = "Избыток" End If End Sub |