ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Q. Autofill question: Can I autofill alpha characters like I can numbers? (https://www.excelbanter.com/excel-programming/306099-q-autofill-question-can-i-autofill-alpha-characters-like-i-can-numbers.html)

George[_22_]

Q. Autofill question: Can I autofill alpha characters like I can numbers?
 
Hi,


I want to be able to fille alpha characters in a cell.
I can easily auto-fill numbers, but is it possible to auto-fille
letters? If so, what do i need to do?

Thanks,
George

agarwaldvk[_16_]

Q. Autofill question: Can I autofill alpha characters like I can numbers?
 
Hopefully, this should help!

From what I know, this can't be done from the frontend worksheets bu
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
through to row 26.


Best regards


Deepak Agarwa

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


George[_22_]

Q. Autofill question: Can I autofill alpha characters like I can numbers?
 
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/



George[_22_]

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?

ForSale[_27_]

Q. Autofill question: Can I autofill alpha characters like I can numbers?
 
Tools | Options
then go to the Custom Lists tab.
in the blank white box to the right, put in the letter of the alphabe
(or whatever you're wanting to fill) seperated with commas. then clic
Add.
Doesn't really save any time if you are only wanting to do this aut
fill once though

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


agarwaldvk[_17_]

Q. Autofill question: Can I autofill alpha characters like I can numbers?
 
You can write this code in a module sheet in VBA. If you cannot see a
module sheet, then insert one by going to Insert - Module.

Also, after Z it will not proceed to AA because the ACSII code for A i
65 and increases by 1 for each letter i.e 66 for B and so on. If yo
want it to go to AA then repeat the same code in a loop once i
reached Z.

Let me know how you went. If you continue to have problems, I shal
write the code for you next time but I would rather have you have a g
at this first.


Best regards


Deepak Agarwa

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



All times are GMT +1. The time now is 01:16 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com