Neil,
To "increment" letters, you need to use the ASCII values of the letters, and increment those, converting them back to letters to use them.
The ASCII value of "A" is 65, "a" is 97, etc.
So, to get the "number" associated with a letter, use the function "Asc":
Code:
Dim intLetter As Integer
Dim strLetter as String
strLetter = "A"
intLetter = Asc(strLetter) ' Returns 65
intLetter = 97
strLetter = Chr(intLetter) ' Returns "a"
I don't have an ASCII table with me, but if you can't find one somewhere on the web, I'll eat my hat.
Once you know the ASCII values of the letters, and the 2 functions to get letters from the number and vice-versa, it's just a matter of using a simple for-loop, incrementing by 1 or -1, depending on the direction you want to go. The sequence of ASCII values isn't a proper numerical progression, so you'll have to "skip" a few ASCII values between "Z" and "a". Values 91 - 96 are in fact special characters.
There are a couple of examples in the Excel VBA help file (that's where I got mine from).
Hope this helps,
Best of,
SmallCraig
![[upsidedown] [upsidedown] [upsidedown]](/data/assets/smilies/upsidedown.gif)