Sub test()
Dim Tab1, i As Long, j As Long, n As Long
Tab1 = Range("i4:P18").Value 'Plage du tableau1 dans un tableau
n = 1
For i = 1 To UBound(Tab1, 1)
If Tab1(i, 6) <> "" Then
For j = 1 To UBound(Tab1, 2)
Tab1(n, j) = Tab1(i, j)
Next j
n = n + 1
End If
Next i
Tab1 = Application.Transpose(Tab1)
ReDim Preserve Tab1(1 To UBound(Tab1, 1), 1 To n - 1) 'redimension pour conserver uniquement les lignes cochées
Tab1 = Application.Transpose(Tab1)
VSortD Tab1, LBound(Tab1, 1), UBound(Tab1, 1), 8 'tri décroissant sur la dernière colonne
Range("I35").Resize(UBound(Tab1, 1), UBound(Tab1, 2)) = Tab1 'écrire le contenu du tableau
End Sub
Private Sub VSortD(ar, LB, UB, ref)
Dim M As Variant, i As Long, j As Long, k As Long, temp
i = UB: j = LB
M = ar(Int((LB + UB) / 2), ref)
Do While j <= i
Do While ar(j, ref) > M: j = j + 1: Loop
Do While ar(i, ref) < M: i = i - 1: Loop
If j <= i Then
For k = LBound(ar, 2) To UBound(ar, 2)
temp = ar(j, k): ar(j, k) = ar(i, k)
ar(i, k) = temp
Next
j = j + 1: i = i - 1
End If
Loop
If LB < i Then VSortD ar, LB, i, ref
If j < UB Then VSortD ar, j, UB, ref
End Sub