Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
With Target
If .CountLarge > 1 Then Exit Sub
If .Address = "$D$5" Then .Offset(, 1).ClearContents: Exit Sub
If .Address <> "$E$5" Then Exit Sub
Dim chn$: chn = .Offset(, -1)
If IsEmpty(.Value) Or chn = "" Then Exit Sub
If Not IsNumeric(.Value) Then Exit Sub
Dim cel As Range, dlg&, lig%
dlg = Cells(Rows.Count, 8).End(3).Row: If dlg < 5 Then Exit Sub
Set cel = Range("H5:H" & dlg).Find(chn, , -4163, 1, 1)
If cel Is Nothing Then Exit Sub
lig = cel.Row: Cells(lig, 9) = Cells(lig, 9) + .Value
End With
End Sub