Versuch mal das hier:
Sub Kombinationen()
'dim
Dim arr1() As Variant
Dim a1&, a2&, a3&, k&, i&, c&
Dim Vars(5) As Variant
'set
Vars(0) = "A"
Vars(1) = "B"
Vars(2) = "C"
Vars(3) = "D"
Vars(4) = "E"
Vars(5) = "F"
k = 5
ReDim arr1((k + 1) ^ 3 - 1, 2)
'kombinationen erstellen
For a1 = 0 To k
For a2 = 0 To k
For a3 = 0 To k
arr1(i, 0) = a1
arr1(i, 1) = a2
arr1(i, 2) = a3
i = i + 1
Next
Next
Next
'variablen einsetzen
For c = 0 To 2
For i = 0 To UBound(arr1)
arr1(i, c) = Vars(arr1(i, c))
Next
Next
'daten übertrage
Range(Cells(1, 1), Cells(UBound(arr1) + 1, UBound(arr1, 2) + 1)).Value = arr1
End Sub
|