Option Compare Text 'la casse est ignorée
Sub Moyenne_pondérée()
Dim t, i&, p#, s#
Range("A2:E" & Rows.Count).Sort [B2], xlAscending, [C2], Header:=xlYes 'tri (sécurité)
t = Range("B3:G" & Range("B" & Rows.Count).End(xlUp).Row + 1)
For i = 1 To UBound(t) - 1
t(i, 6) = ""
p = p + t(i, 3) * t(i, 4)
s = s + t(i, 3)
If t(i, 1) & t(i, 2) <> t(i + 1, 1) & t(i + 1, 2) Then
t(i, 6) = p / s
p = 0
s = 0
End If
Next
[G3].Resize(UBound(t)) = Application.Index(t, 0, 6)
Range("G" & UBound(t) + 2 & ":G" & Rows.Count).ClearContents
End Sub