Alphanumeric Sequencing
Hi,
I am trying to make a sequence in Excel that would start at 3ba and continue to 3zz. I have tried dragging the fill handle to no avail. Any other ideas would be greatly appreciated!
An example of how the sequence should look is below:
3ba
3bb
3bc
3bd
3be
3bf
3bg
3bh
3bi
3bj
3bk
3bl
3bm
3bn
3bo
3bp
3bq
3br
3bs
3bt
3bu
3bv
3bw
3bx
3by
3bz
3ca
3cb
3cc
through
3zz
Chr Function (VBA)
Hi,
I've got the result using the code below:
Sub Sequence()
Dim i As Integer
Dim j As Integer
Dim r As Long
Dim strStart As String
' set the first character of your sequence/string
strStart = "3"
' set the first row of the sheet where you want to put the data
r = 1
' "97" is a code of "a" letter, 122 - "z"
For i = 98 To 122
For j = 97 To 122
'Chr(x) - it returns a letter coded by "x" numer
n = strStart + Chr(i) + Chr(j)
sh.Cells(r, 1).Value = n
r = r + 1
Next j
Next i
End Sub
I hope it helps :o)