bonsoir,
une proposition
ps avec 10 positions qui peuvent prendre la valeur 0 ou 1, le nombre de combinaisons possibles est 2^10 et non 10! je te conseille de ne pas dépasser 20, si tu ne veux pas attendre très longtemps !
Dim v() As Integer, sol As Long, col As Integer, solution() As String
Sub aargh()
nombre = 10
Application.ScreenUpdating = False
sol = -1
col = 0
Erase solution
Erase v
ReDim v(1 To nombre)
boucle nombre
If sol >= 0 Then Cells(1, 1).Resize(sol + 1) = Application.Transpose(solution)
Application.ScreenUpdating = True
End Sub
Sub boucle(nombre, Optional niveau = 1)
For i = 0 To 1
v(niveau) = i
If niveau = nombre Then
sol = sol + 1
ReDim Preserve solution(sol)
solution(sol) = "'"
For j = 1 To nombre
solution(sol) = solution(sol) & v(j)
Next j
If sol = 65535 Then
col = col + 1
Cells(1, col).Resize(sol + 1) = Application.Transpose(solution)
sol = -1
End If
Else
boucle nombre, niveau + 1
End If
Next i
End Sub