View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Andrew Taylor Andrew Taylor is offline
external usenet poster
 
Posts: 225
Default Three Letter List

Try this:

Sub MakeList()
Dim i As Integer, j As Integer, k As Integer
Dim ascA As Integer
ascA = Asc("A")
For i = 0 To 25
For j = 0 To 25
For k = 0 To 25
Cells(i * 26 * 26 + j * 26 + k + 1, 1) = Chr(ascA + i)
& Chr(ascA + j) & Chr(ascA + k)
Next
Next
Next
End Sub


On 8 Apr, 14:49, Whelan wrote:
Hello, I hope you can help me with this.

I want to create in Excel a three letter list Starting in field cell A1 with
AAA, cell A2 being AAB, Cell A3 being AAC, and ending up with ZZZ. Rather
than typing each out I was just going to code it in VB. However I've come up
short. Way short. I'm thinking a loop is required or a Do Until command, but
can't seem to get the exact process right.

Any advice would be welcome!

Thanks,

Whelan