Private Sub Worksheet_Change(ByVal Target As Range)
Dim i As Long, SumMonth As Double, SumYear As Double
If Not Intersect(Target, Range("A2:A35")) Is Nothing Then
Application.EnableEvents = False
For i = 2 To 35
If Cells(i, 1) = "a" Then
SumMonth = SumMonth + Cells(i, 4)
SumYear = SumYear + Cells(i, 6)
End If
Next
End If
Cells(36, 6) = SumMonth
Cells(41, 6) = SumYear
Application.EnableEvents = True
End Sub
Зачем ячейки для итоговых сумм сделали объединёнными? Ведь высоту ячейки можно менять...