Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a spreadsheet where the column number is dynamic, ie it change
based on a access query from which the spreadsheet is exported. Can anybody tell me how to find the column letter(like A,B, C...AA, AB if I know the coulm number(like 1,2,3...27,28). In other words how do I find the column letter if I know the colum number. Thanks, William -- Message posted from http://www.ExcelForum.com |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
one way (in vBA): msgbox mid(cells(1,col_index).address,2,instr(2,cells(1,c ol_index).address,"$" )-2) -- Regards Frank Kabel Frankfurt, Germany "tich1234 " schrieb im Newsbeitrag ... I have a spreadsheet where the column number is dynamic, ie it changes based on a access query from which the spreadsheet is exported. Can anybody tell me how to find the column letter(like A,B, C...AA, AB) if I know the coulm number(like 1,2,3...27,28). In other words how do I find the column letter if I know the column number. Thanks, William, --- Message posted from http://www.ExcelForum.com/ |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have an example on my website.
For archiving purposes: Sub test() Dim lngColumn As Long, strColumn As String lngColumn = 27 strColumn = Split(Columns(lngColumn).Address(, False), ":")(1) MsgBox strColumn End Sub -- Rob van Gelder - http://www.vangelder.co.nz/excel "tich1234 " wrote in message ... I have a spreadsheet where the column number is dynamic, ie it changes based on a access query from which the spreadsheet is exported. Can anybody tell me how to find the column letter(like A,B, C...AA, AB) if I know the coulm number(like 1,2,3...27,28). In other words how do I find the column letter if I know the column number. Thanks, William, --- Message posted from http://www.ExcelForum.com/ |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
One of a few other options:
n=26, or 27 ColumnLetter = Left$(Cells(n).Address(False, False), (n <= 26) + 2) -- Dana DeLouis Using Windows XP & Office XP = = = = = = = = = = = = = = = = = "tich1234 " wrote in message ... I have a spreadsheet where the column number is dynamic, ie it changes based on a access query from which the spreadsheet is exported. Can anybody tell me how to find the column letter(like A,B, C...AA, AB) if I know the coulm number(like 1,2,3...27,28). In other words how do I find the column letter if I know the column number. Thanks, William, --- Message posted from http://www.ExcelForum.com/ |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
MsgBox Replace(Cells(1, col_index).Address(0, 0), 1, "") -- Regards, Soo Cheon Jheong Seoul, Korea _ _ ^ąŻ^ -- |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
using row number or column letters in formula | Excel Worksheet Functions | |||
Excel, how do I change the column headings from letters to number | Excel Discussion (Misc queries) | |||
How can I change column designation from number to letters? | Excel Discussion (Misc queries) | |||
how can I sort a column that consists of sizes (letters not number | Charts and Charting in Excel | |||
how i write a number on a column A and see that number on letters. | Excel Worksheet Functions |