Private Sub Worksheet_Change(ByVal Target As Range)
Dim d As Object, c As Range, a, b
Application.EnableEvents = False
On Error Resume Next 'si aucune SpecialCell (aucun joueur)
Set d = CreateObject("Scripting.Dictionary")
For Each c In [H3:AB14,H17:AB28].SpecialCells(xlCellTypeConstants, 2)
d(c.Value) = d(c.Value) + c(1, 2)
Next
a = d.items: b = d.keys
tri a, b, 0, UBound(a)
[C11].Resize(d.Count) = Application.Transpose(b)
[E11].Resize(d.Count) = Application.Transpose(a)
Range("C" & d.Count + 11 & ":E" & Rows.Count) = "" 'RAZ en dessous
Application.EnableEvents = True
End Sub
Sub tri(a, b, gauc, droi) ' Quick sort
Dim ref, g, d, temp
ref = a((gauc + droi) \ 2)
g = gauc: d = droi
Do
Do While a(g) > ref: g = g + 1: Loop
Do While ref > a(d): d = d - 1: Loop
If g <= d Then
temp = a(g): a(g) = a(d): a(d) = temp
temp = b(g): b(g) = b(d): b(d) = temp
g = g + 1: d = d - 1
End If
Loop While g <= d
If g < droi Then Call tri(a, b, g, droi)
If gauc < d Then Call tri(a, b, gauc, d)
End Sub