Newonexcel
New Member
- Joined
- Jun 4, 2012
- Messages
- 4
Hi to everyone on this forum a few days ago I was looking
for a code to generate 19683 permutations out of three
letters abc and I found it here on mrexcel board RUGILA
gave it to another member I only changed the letters
anyway, I'm now trying to get another code to group all
permutations such as :
AAAAAAAAB = 36
AAAAAAAAC = 36
7A + 2B = 36
7A + 2C = 36
AAAAAAABC = 72p
AAAAAA + 3B = 84
AAAAAA + 3C = 84 and so on.
This is the code I copied from mrexcel dated Dec 18 2009
Code:
Sub allup()
Dim a, n As Integer, c(), k As Long
Dim u1 As Integer, u2 As Integer, u3 As Integer
Dim u4 As Integer, u5 As Integer, u6 As Integer
Dim u7 As Integer, u8 As Integer, u9 As Integer
a = Array("C", "M", "U")
n = UBound(a) + 1
ReDim c(1 To Rows.Count, 1 To 9)
For u1 = 1 To n
For u2 = 1 To n
For u3 = 1 To n
For u4 = 1 To n
For u5 = 1 To n
For u6 = 1 To n
For u7 = 1 To n
For u8 = 1 To n
For u9 = 1 To n
k = k + 1
c(k, 9) = a(u9 - 1)
c(k, 8) = a(u8 - 1)
c(k, 7) = a(u7 - 1)
c(k, 6) = a(u6 - 1)
c(k, 5) = a(u5 - 1)
c(k, 4) = a(u4 - 1)
c(k, 3) = a(u3 - 1)
c(k, 2) = a(u2 - 1)
c(k, 1) = a(u1 - 1)
Next u9, u8, u7, u6, u5, u4, u3, u2, u1
Cells(1).Resize(k, 9) = c
End Sub
If someone one on this forum could help me with a code or
tell me what I can do to get what I want it wil be truly appreciated
I'd like to thank RUGILA and all the people helping others in this
Forum, Thanks in advance.
for a code to generate 19683 permutations out of three
letters abc and I found it here on mrexcel board RUGILA
gave it to another member I only changed the letters
anyway, I'm now trying to get another code to group all
permutations such as :
AAAAAAAAB = 36
AAAAAAAAC = 36
7A + 2B = 36
7A + 2C = 36
AAAAAAABC = 72p
AAAAAA + 3B = 84
AAAAAA + 3C = 84 and so on.
This is the code I copied from mrexcel dated Dec 18 2009
Code:
Sub allup()
Dim a, n As Integer, c(), k As Long
Dim u1 As Integer, u2 As Integer, u3 As Integer
Dim u4 As Integer, u5 As Integer, u6 As Integer
Dim u7 As Integer, u8 As Integer, u9 As Integer
a = Array("C", "M", "U")
n = UBound(a) + 1
ReDim c(1 To Rows.Count, 1 To 9)
For u1 = 1 To n
For u2 = 1 To n
For u3 = 1 To n
For u4 = 1 To n
For u5 = 1 To n
For u6 = 1 To n
For u7 = 1 To n
For u8 = 1 To n
For u9 = 1 To n
k = k + 1
c(k, 9) = a(u9 - 1)
c(k, 8) = a(u8 - 1)
c(k, 7) = a(u7 - 1)
c(k, 6) = a(u6 - 1)
c(k, 5) = a(u5 - 1)
c(k, 4) = a(u4 - 1)
c(k, 3) = a(u3 - 1)
c(k, 2) = a(u2 - 1)
c(k, 1) = a(u1 - 1)
Next u9, u8, u7, u6, u5, u4, u3, u2, u1
Cells(1).Resize(k, 9) = c
End Sub
If someone one on this forum could help me with a code or
tell me what I can do to get what I want it wil be truly appreciated
I'd like to thank RUGILA and all the people helping others in this
Forum, Thanks in advance.