Sub Combinaisons()
Dim t, dico As Object, tablo, ub&, i&, a, b, c, d, e, x$, nmax&, n&, liste$()
t = Timer
Set dico = CreateObject("Scripting.Dictionary")
tablo = [A1:T6000] 'matrice, plus rapide
ub = UBound(tablo)
For i = 1 To ub
Application.ScreenUpdating = True 'rafraîchi l'écran
Cells(i, "A").Resize(, 22).Select
If t > Timer Then t = t - 86400 'pour le passage de minuit Cells(i, "U") = (Timer - t) / 86400
Cells(i, "V") = i / ub
[Y1] = "=TREND(U1:U" & i & ",V1:V" & i & ",1)" 'durée extrapolée
DoEvents
For a = 1 To 16
For b = a + 1 To 17
For c = b + 1 To 18
For d = c + 1 To 19
For e = d + 1 To 20
x = tablo(i, a) & " " & tablo(i, b) & " " & tablo(i, c) & " " & tablo(i, d) & " " & tablo(i, e)
dico(x) = dico(x) + 1
Next e, d, c, b, a, i
nmax = Application.Max(dico.items)
a = dico.keys
b = dico.items
nmax = Application.Max(b)
For i = 0 To UBound(a)
If b(i) = nmax Then
ReDim Preserve liste(n) 'base 0
liste(n) = a(i)
n = n + 1
End If
Next i
[AB1] = nmax
[AD1] = n
If n > 65536 Then n = 65536
[W2].Resize(n) = Application.Transpose(liste)
[W2].Offset(n).Resize(Rows.Count - n - 1).ClearContents 'RAZ en dessous
End Sub