Sub test()
Dim der&, min&, max&, dico, t, i&, x
If ActiveSheet.FilterMode Then ActiveSheet.ShowAllData
der = Cells(Rows.Count, "a").End(xlUp).Row
t = Range("a2:c" & der).Value
min = Application.min(Range("a2:a" & der))
max = Application.max(Range("a2:a" & der))
Set dico = CreateObject("scripting.dictionary")
dico.CompareMode = TextCompare
For i = min To max: dico.Add i, "": Next
For i = 1 To UBound(t)
If t(i, 2) = "a" Then dico(t(i, 1)) = IIf(dico(t(i, 1)) = "", 0, dico(t(i, 1))) + t(i, 3)
Next i
ReDim r(1 To max, 1 To 2): i = 0
For Each x In dico.Keys: i = i + 1: r(i, 1) = x: r(i, 2) = dico(x): Next
Range("i2:j" & der).Clear: i = 0
Range("i2").Resize(dico.Count, 2) = r
Range("i2").Resize(dico.Count, 2).Borders.LineStyle = xlContinuous
End Sub