Registriert seit: 08.11.2021
Version(en): 2102
Ich habe mit folgendem Code versucht alle Kombinationen aufzulisten:
Sub ListAllCombinations()
'Updateby Extendoffice
Dim xDRg1, xDRg2, xDRg3, xDRg4, xDRg5, xDRg6, xDRg7, xDRg8, xDRg9, xDRg10, xDRg11, xDRg12, xDRg13, xDRg14, xDRg15, xDRg16 As Range
Dim xRg As Range
Dim xStr As String
Dim xFN1, xFN2, xFN3, xFN4, xFN5, xFN6, xFN7, xFN8, xFN9, xFN10, xFN11, xFN12, xFN13, xFN14, xFN15, xFN16 As Integer
Dim xSV1, xSV2, xSV3, xSV4, xSV5, xSV6, xSV7, xSV8, xSV9, xSV10, xSV11, xSV12, xSV13, xSV14, xSV15, xSV16 As String
Set xDRg1 = Range("A2") 'First column data
Set xDRg2 = Range("B2") 'Second column data
Set xDRg3 = Range("C2") 'Third column data
Set xDRg4 = Range("D2")
Set xDRg5 = Range("E2")
Set xDRg6 = Range("F2")
Set xDRg7 = Range("G2")
Set xDRg8 = Range("H2")
Set xDRg9 = Range("I2")
Set xDRg10 = Range("J2")
Set xDRg11 = Range("K2")
Set xDRg12 = Range("L2")
Set xDRg13 = Range("M2")
Set xDRg14 = Range("N2")
Set xDRg15 = Range("O2")
Set xDRg16 = Range("P2")
xStr = "," 'Separator
Set xRg = Range("A4") 'Output cell
For xFN1 = 1 To xDRg1.Count
xSV1 = xDRg1.Item(xFN1).Text
For xFN2 = 1 To xDRg2.Count
xSV2 = xDRg2.Item(xFN2).Text
For xFN3 = 1 To xDRg3.Count
xSV3 = xDRg3.Item(xFN3).Text
For xFN4 = 1 To xDRg4.Count
xSV4 = xDRg4.Item(xFN4).Text
For xFN5 = 1 To xDRg5.Count
xSV5 = xDRg5.Item(xFN5).Text
For xFN6 = 1 To xDRg6.Count
xSV6 = xDRg6.Item(xFN6).Text
For xFN7 = 1 To xDRg7.Count
xSV7 = xDRg7.Item(xFN7).Text
For xFN8 = 1 To xDRg8.Count
xSV8 = xDRg8.Item(xFN8).Text
For xFN9 = 1 To xDRg9.Count
xSV9 = xDRg9.Item(xFN9).Text
For xFN10 = 1 To xDRg10.Count
xSV10 = xDRg10.Item(xFN10).Text
For xFN11 = 1 To xDRg11.Count
xSV11 = xDRg11.Item(xFN11).Text
For xFN12 = 1 To xDRg12.Count
xSV12 = xDRg12.Item(xFN12).Text
For xFN13 = 1 To xDRg13.Count
xSV13 = xDRg13.Item(xFN13).Text
For xFN14 = 1 To xDRg14.Count
xSV14 = xDRg14.Item(xFN14).Text
For xFN15 = 1 To xDRg15.Count
xSV15 = xDRg15.Item(xFN15).Text
For xFN16 = 1 To xDRg16.Count
xSV16 = xDRg16.Item(xFN16).Text
xRg.Value = xSV1 & xStr & xSV2 & xStr & xSV3 & xStr & xSV4 & xStr & xSV5 & xStr & xSV6 & xStr & xSV7 & xStr & xSV8 & xStr & xSV9 & xStr & xSV10 & xStr & xSV11 & xStr & xSV12 & xStr & xSV13 & xStr & xSV14 & xStr & xSV15 & xStr & xSV16
Set xRg = xRg.Offset(1, 0)
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
End Sub
Ich versuche alle Kombinationen die möglich sind aufzulisten steht bsp in A auch ein a und in P auch ein p
Möchte ich:
a
a,b
a,b,c
a,b,c,d...
...
a,b,c,d,e....,p
und auch f,g,h,....
aufgelistet bekommen, aktuell bekomme ich einfach nur das angezeigt:
A,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p