Sub Combinaisons()
Dim P, filtre$, R(), a%, b%, c%, d%, e%, n&
P = Application.Transpose(Application.Transpose([J1:S1]))
filtre = Replace(LCase([V1]), "tout", "")
If filtre = "" Then filtre = "*"
ReDim R(1 To Application.Combin(10, 5), 1 To 8)
For a = 1 To 6
For b = a + 1 To 7
For c = b + 1 To 8
For d = c + 1 To 9
For e = d + 1 To 10
n = n + 1
R(n, 1) = P(a)
R(n, 2) = P(b)
R(n, 3) = P(c)
R(n, 4) = P(d)
R(n, 5) = P(e)
R(n, 7) = R(n, 1) * R(n, 2) * R(n, 3) * R(n, 4) * R(n, 5) 'produit des éléments
R(n, 8) = R(n, 7) Mod 9 'modulo 9
If Not R(n, 8) Like filtre Then n = n - 1 'annule la ligne
Next e, d, c, b, a
'---restitution---
With [A2] '1ère cellule de restitution, à adapter
If n Then .Resize(n, 8) = R
.Offset(n).Resize(Rows.Count - n - .Row + 1, 8).ClearContents 'RAZ en dessous
End With
End Sub