Option Explicit
Sub consolider()
Dim TbE(), TbS(), i As Long, Fc As Worksheet, d As Object, clé, lig As Integer
Set Fc = ThisWorkbook.Sheets("consolide")
Set d = CreateObject("Scripting.Dictionary")
TbE = Fc.UsedRange.Value
ReDim TbS(1 To UBound(TbE), 1 To 4)
For i = LBound(TbE) + 1 To UBound(TbE)
clé = TbE(i, 4) & "|" & TbE(i, 12)
If d.exists(clé) Then
lig = d(clé) ' Récupération index Tbs()
Else
d(clé) = d.Count + 1
lig = d.Count
TbS(lig, 1) = TbE(i, 4)
TbS(lig, 2) = TbE(i, 12) ' Nouvelle clé
End If
' Totalisation colonnes numériques
TbS(lig, 3) = TbS(lig, 3) + TbE(i, 7)
TbS(lig, 4) = TbS(lig, 4) + TbE(i, 11)
Next i
With Feuil3 ' feuille et cellule de départ à adapter
.[F1].CurrentRegion.Offset(1).Delete shift:=xlShiftUp
.[F2].Resize(d.Count, UBound(TbS, 2)) = TbS
.[F2].CurrentRegion.Borders.LineStyle = 1
End With
End Sub