Sub Dispatche()
Application.ScreenUpdating = False
DL = Range("A65500").End(xlUp).Row
Nbits = DL - 1
IndexW = 1
With Sheets("Feuil2")
.Cells.ClearContents
For N = 0 To 2 ^ (DL - 1) - 1 ' DL-1 : Nombre d'éléments. 2 ^ (DL - 1) - 1 : Nombre de combinaisons
Mot = Right("0000" & Application.Dec2Bin(N), DL - 1) ' met la combinaison en binaire formaté au nombre de bit d'entrée
Titre = Cells(1, "A")
Ligne = IndexW
For B = 1 To Nbits ' Pour chaque bits
If Val(Mid(Mot, B, 1)) = 0 Then ' si 0 on met à droite
.Cells(IndexW + B, "C") = Cells(B + 1, "A")
Else
.Cells(IndexW + B, "B") = Cells(B + 1, "A") ' si 1 on met à gauche
Titre = Titre & Cells(B + 1, "A") ' on ajoute l'élément au titre
End If
Next B
.Cells(Ligne, "A") = Titre ' on range le titre
IndexW = IndexW + Nbits + 1
Next N
.Activate
End With
End Sub