jayzeus
07-14-2008, 05:30 PM
I've been trying to create an array that consists of consecutive double characters (AA, AB, AC, etc), from AA to AZ.
I think I've got a logic right, I'm starting with two arrays
A1 = Array("A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z")
A2 = Array("A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z")
Then I was trying to run it through two for loops, and spit it out into a third containter array.
For some reason, maybe it's because how for loops are executed in VBA, I either keep running out of indexes or I'm not doing anything at all.
Any ideas on how to accomplish that? Is there an easier way to do that?
Here's what I have so far:
For m = 0 To 24
For n = 0 To 24
A3(c) = A1(m) + A2(n)
c = c + 1
Next n
Next m
Except that, in this case, I lose the last chars of the set. If I change the indexes to 25 it says that the subscript is out of range. What gives?
I think I've got a logic right, I'm starting with two arrays
A1 = Array("A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z")
A2 = Array("A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z")
Then I was trying to run it through two for loops, and spit it out into a third containter array.
For some reason, maybe it's because how for loops are executed in VBA, I either keep running out of indexes or I'm not doing anything at all.
Any ideas on how to accomplish that? Is there an easier way to do that?
Here's what I have so far:
For m = 0 To 24
For n = 0 To 24
A3(c) = A1(m) + A2(n)
c = c + 1
Next n
Next m
Except that, in this case, I lose the last chars of the set. If I change the indexes to 25 it says that the subscript is out of range. What gives?