Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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/ |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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? |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Autofill question I think... | Excel Discussion (Misc queries) | |||
Autofill question | Excel Discussion (Misc queries) | |||
Autofill: Need to autofill one week block, (5) weekday only into cells. | Excel Discussion (Misc queries) | |||
autofill question | Excel Discussion (Misc queries) | |||
Autofill question | Excel Programming |