View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
George[_22_] George[_22_] is offline
external usenet poster
 
Posts: 9
Default Q. Autofill question: Can I autofill alpha characters like I can numbers?

On Sat, 07 Aug 2004 01:29:13 GMT, George
wrote:

On Thu, 5 Aug 2004 22:26:50 -0500, agarwaldvk
wrote:

Hopefully, this should help!

From what I know, this can't be done from the frontend worksheets but
you can do it programmatically using VBA. Have a look at this :-

Sub test()
Dim cnt As Integer, tempval As Integer, final As Integer
cnt = 1
final = 26
tempval = 65 'for upper case A
Do While cnt <= final
Cells(cnt, 1).Value = Chr(tempval)
tempval = tempval + 1
cnt = cnt + 1
Loop
End Sub

The output is letters A through to Z in the first column in rows 1
through to row 26.



Can you please give me a little more insight?
I put the code in the VBA editor, but exactly where, I'm not sure.

TIA
George

Best regards


Deepak Agarwal


---
Message posted from http://www.ExcelForum.com/


Also, I forgot to ask, this will continue to

AA, AB, AC, AD and so on, after it reaches the first Z, correct?