For my work, I created the following code (and it works! - although it takes a while). Unfortunately, it is anything but practical. Can you tell me a more pro-elbow way?
This is my code: For 21 different scenarios that can take values from 1 to 5, it shows all the possible combinations. Exit examples:
1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1/1
1/1/1/1/5/1/1/1/1/1/4/1/1/1/5/5/2/3/1/2/1
5/5/5/1/5/5/5/2/2/2/4/2/3/3/5/5/2/3/1/2/1
Dim a, b, c, d, f, g, h, j, k, l, m, n, o, p, q, r, s, t, u, w, y, x
Dim V(21) As Integer
Dim texto As String
texto = ""
For a = 1 To 5
V(1) = a
For b = 1 To 5
V(2) = b
For c = 1 To 5
V(3) = c
For d = 1 To 5
V(4) = d
For f = 1 To 5
V(5) = f
For g = 1 To 5
V(6) = g
For h = 1 To 5
V(7) = h
For j = 1 To 5
V(8) = j
For k = 1 To 5
V(9) = k
For l = 1 To 5
V(10) = l
For m = 1 To 5
V(11) = m
For n = 1 To 5
V(12) = n
For o = 1 To 5
V(13) = o
For p = 1 To 5
V(14) = p
For q = 1 To 5
V(15) = q
For r = 1 To 5
V(16) = r
For s = 1 To 5
V(17) = s
For t = 1 To 5
V(18) = t
For u = 1 To 5
V(19) = u
For w = 1 To 5
V(20) = w
For y = 1 To 5
V(21) = y
For x = 1 To 21
texto = texto & V(x) & " / "
Next
ListBox1.Items.Add(texto)
texto = ""
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
End Sub