Bonjour
Bonjour à tous
Une variante
Option Explicit
Dim tabloA, tabloB, TabloR(), dico As Object
Dim i&
Sub Sommes()
tabloA = Range("B2:B" & Range("B" & Rows.Count).End(xlUp).Row)
tabloB = Range("H2:H" & Range("B" & Rows.Count).End(xlUp).Row)
Set dico = CreateObject("Scripting.Dictionary")
For i = 1 To UBound(tabloA, 1)
If dico.exists("Somme " & tabloA(i, 1)) Then
dico("Somme " & tabloA(i, 1)) = dico("Somme " & tabloA(i, 1)) + tabloB(i, 1)
Else
dico("Somme " & tabloA(i, 1)) = tabloB(i, 1)
End If
Next i
Range("J1").CurrentRegion.Clear
Range("J1").Resize(1, dico.Count) = dico.KEYS
Range("J2").Resize(1, dico.Count) = dico.items
Range("J2").Resize(2, dico.Count).HorizontalAlignment = xlCenter
Range("J1").Resize(2, dico.Count).Borders.LineStyle = xlContinuous
End Sub
Bye !