Option Explicit
Dim i&, j&, dercol&, dico As Object
Sub MetreAjour()
With Sheets("Feuil1")
Set dico = CreateObject("Scripting.Dictionary")
dercol = .Cells(1, Columns.Count).End(xlToLeft).Column
For j = 4 To dercol Step 3
For i = 3 To .Cells(Rows.Count, j).End(xlUp).Row
If dico.exists(.Cells(i, j).Value) Then
dico(Cells(i, j).Value) = dico(.Cells(i, j).Value) + .Cells(i, j + 1).Value
Else
dico(.Cells(i, j).Value) = .Cells(i, j + 1).Value
End If
Next i
Next j
With Sheets("Feuil2")
.Activate
.Range("A2").CurrentRegion.Offset(2, 0).ClearContents
.Range("A2").Range("A3").Resize(dico.Count, 1) = Application.Transpose(dico.keys)
.Range("A2").Range("B3").Resize(dico.Count, 1) = Application.Transpose(dico.items)
.Range("A2").Range("A3:B" & Range("A" & Rows.Count).End(xlUp).Row).Sort key1:=Range("A3"), _
order1:=xlAscending, Header:=xlNo
End With
End With
End Sub