Sub GrandesValeurs()
Set Pl = Range("A2:G" & Range("A" & Rows.Count).End(xlUp).Row)
Set dico = CreateObject("Scripting.Dictionary")
T = Range("A2:A" & Range("A" & Rows.Count).End(xlUp).Row)
For Each c In T
dico(c) = dico(c)
Next c
temp = dico.keys
Call tri(temp, LBound(temp), UBound(temp))
ReDim T2(dico.Count, 3)
For i = LBound(temp) To UBound(temp)
T2(i, 0) = temp(i)
For j = 1 To Pl.Rows.Count
If Pl(j, 1) = temp(i) And Pl(j, 2) > NCS Then NCS = Pl(j, 2)
If Pl(j, 1) = temp(i) And Pl(j, 6) > QS Then QS = Pl(j, 6)
If Pl(j, 1) = temp(i) And Pl(j, 7) > QT Then QT = Pl(j, 7)
Next j
T2(i, 1) = NCS: NCS = 0
T2(i, 2) = QS: QS = 0
T2(i, 3) = QT: QT = 0
Next i
[J2].Resize(UBound(T2) + 1, UBound(T2, 2) + 1) = T2
End Sub
Sub tri(a, gauc, droi) ' Quick sort
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
g = g + 1: D = D - 1
End If
Loop While g <= D
If g < droi Then Call tri(a, g, droi)
If gauc < D Then Call tri(a, gauc, D)
End Sub