XL 2019 Générateur de mot automatiquement selon une liste définie

ColinWOOD

XLDnaute Nouveau
Salut !

J'ai grandement besoin d'aide...
Capture.PNG


En gros je voudrais générer de manière automatique toutes les possibilité de nom avec les deux mots. Mais je ne sais pas comment m'y pendre. J'ai trouvé une technique super longue... Et là ça va il n'y a que 8 mots mais moi j'en ai 400 !

Si vous avez une solution je suis preneur !!!!

Merci par avance
 
Solution
re
c'est pourtant simple
dans le module thisworkbook tu met
VB:
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
If Not Intersect([A:B], Target) Is Nothing Then test
End Sub
Sub test()
    Dim tablo, tablo2, ligne&, col&
    tablo = Range("A1:A" & Cells(Rows.Count, "A").End(xlUp).Row).Resize(, 2).Value
    ReDim tablo2(1 To UBound(tablo), 1 To UBound(tablo) + 1)
    For ligne = 1 To UBound(tablo)
        For col = 1 To UBound(tablo)
            tablo2(ligne, col) = tablo(ligne, 1) & " " & tablo(col, 2)
        Next
    Next
[D1].Resize(UBound(tablo), UBound(tablo)) = tablo2
End Sub
comme ça des un changement ça te met le tableau a jour
demo7.gif


c'est du travail mâché

mapomme

XLDnaute Barbatruc
Supporter XLD
Re,

Par VBA.
Code dans le module de la feuille "Feuil1":
VB:
Sub MarionsLes()
Dim t1, t2, i&, j&
   Range(Range("e2"), Range("e2").End(xlToRight).End(xlDown)).Clear
   t1 = Range("a1").Resize(Cells(Rows.Count, "a").End(xlUp).Row)
   t2 = Range("b1").Resize(Cells(Rows.Count, "b").End(xlUp).Row)
   If Not IsArray(t1) Or Not IsArray(t2) Then Exit Sub
   ReDim t(1 To UBound(t1) - 1, 1 To UBound(t2) - 1)
   For i = 2 To UBound(t1): For j = 2 To UBound(t2): t(i - 1, j - 1) = t1(i, 1) & " " & t2(j, 1): Next j, i
   Range("e2").Resize(UBound(t), UBound(t, 2)) = t
End Sub

edit : bonjour @Usine à gaz ;)
 

Pièces jointes

  • ColinWOOD- couples- v2.xlsm
    17.6 KB · Affichages: 4
Dernière édition:

patricktoulon

XLDnaute Barbatruc
re
c'est pourtant simple
dans le module thisworkbook tu met
VB:
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
If Not Intersect([A:B], Target) Is Nothing Then test
End Sub
Sub test()
    Dim tablo, tablo2, ligne&, col&
    tablo = Range("A1:A" & Cells(Rows.Count, "A").End(xlUp).Row).Resize(, 2).Value
    ReDim tablo2(1 To UBound(tablo), 1 To UBound(tablo) + 1)
    For ligne = 1 To UBound(tablo)
        For col = 1 To UBound(tablo)
            tablo2(ligne, col) = tablo(ligne, 1) & " " & tablo(col, 2)
        Next
    Next
[D1].Resize(UBound(tablo), UBound(tablo)) = tablo2
End Sub
comme ça des un changement ça te met le tableau a jour
demo7.gif


c'est du travail mâché
 

Membres actuellement en ligne

Statistiques des forums

Discussions
312 329
Messages
2 087 334
Membres
103 520
dernier inscrit
Azise