22 entités et 3 variables

adri26

XLDnaute Nouveau
Bonjour voici mon problème,

Je souhaite généré autant de combinaison possible avec 22 entités qui peuvent chacune comporter 3 variables.
Autant dire

ABC
ABC
ABC
ABC... etc 22 fois.

Je souhaiterai obtenir toute les combinaisons uniques.

voila la macro que j'utilise, cela marche avec 10 entités, mais impossible avec 22. (Mon pc plante)
Merci, Cdt.


Sub combi()
Columns("D").Clear
For i = 1 To 3
For j = 1 To 3
For k = 1 To 3
For l = 1 To 3
For m = 1 To 3
For n = 1 To 3
For o = 1 To 3
For p = 1 To 3
For q = 1 To 3
For r = 1 To 3
For s = 1 To 3
For t = 1 To 3
For u = 1 To 3
For v = 1 To 3
For w = 1 To 3
For x = 1 To 3
For y = 1 To 3
For z = 1 To 3
For a = 1 To 3
For b = 1 To 3
For c = 1 To 3
For d = 1 To 3
[D65536].End(xlUp).Offset(1, 0).Value = Cells(1, i).Value & _
Cells(2, j).Value & Cells(3, k).Value & Cells(4, l).Value & _
Cells(5, m).Value & Cells(6, n).Value & Cells(7, o).Value & _
Cells(8, p).Value & Cells(9, q).Value & Cells(10, r).Value & _
Cells(11, s).Value & Cells(12, t).Value & Cells(13, u).Value & _
Cells(14, v).Value & Cells(15, w).Value & Cells(16, x).Value & _
Cells(17, y).Value & Cells(18, z).Value & Cells(19, a).Value & _
Cells(20, b).Value & Cells(21, c).Value & Cells(22, d)
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next

End Sub
 

jpb388

XLDnaute Accro
Re : 22 entités et 3 variables

Bonjour à tous
Teste et dis moi
Code:
Sub Conbi3Var()
Dim DerLg&, Cel As Range
DerLg = Range("A" & Rows.Count).End(xlUp).Row

For Each Cel In Range("A2:A" & DerLg)
    Range("B" & Rows.Count).End(xlUp).Offset(1, 0) = Cel
    Range("B" & Rows.Count).End(xlUp).Offset(1, 0) = Left(Cel, 1) & Right(Cel, 1) & Mid(Cel, 2, 1)
Next Cel

End Sub
 

Paf

XLDnaute Barbatruc
Re : 22 entités et 3 variables

Bonjour,

Je souhaite généré autant de combinaison possible avec 22 entités qui peuvent chacune comporter 3 variables.
Rien compris à ce que vous voulez faire
cela marche avec 10 entités, mais impossible avec 22. (Mon pc plante)
Il doit bien y avoir un message d'erreur ?
sous excel 2003, chaque colonne est limitée à 65536 lignes.
Tel que le montre votre code, il devrait y avoir quelque 31381059609 possibilités !

a priori on fait afficher dans une cellule le contenu d'autres cellules . Sans classeur contenant des données pas facile de suivre !

Bonne suite
 

Discussions similaires

Réponses
5
Affichages
262
Réponses
6
Affichages
320