Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.newusers,microsoft.public.excel.misc,microsoft.public.excel.programming
|
|||
|
|||
![]()
Is there some function in Excel (VBA) that will get me the column
alphabet if I provide the column number, or do I have to write one. I ask because I know that there is, yet I recall I wrote this functionality for the previous application, and I don't want to: (1) Reuse it, if there's something in-built (2) Re-invent the wheel Help! PS: I'm looking for something like: code:-------------------------------------------------------------------------------- Function GetAlphabet(ByVal ColumnNumber as Long) as String -------------------------------------------------------------------------------- which if I call must say: code:-------------------------------------------------------------------------------- GetAlphabet(1) -------------------------------------------------------------------------------- Output: "A" |
#2
![]()
Posted to microsoft.public.excel.newusers,microsoft.public.excel.misc,microsoft.public.excel.programming
|
|||
|
|||
![]()
activecell.Address
will give you row and column. to get just the column Left(activecell.Address(0,0), 1 +(-1*(activecell.Column 26))) or Left(activecell.Address(0,0), 2 + (activecell.Column <= 26)) -- Regards, Tom Ogilvy "Sathyaish" wrote in message om... Is there some function in Excel (VBA) that will get me the column alphabet if I provide the column number, or do I have to write one. I ask because I know that there is, yet I recall I wrote this functionality for the previous application, and I don't want to: (1) Reuse it, if there's something in-built (2) Re-invent the wheel Help! PS: I'm looking for something like: code:----------------------------------------------------------------------- --------- Function GetAlphabet(ByVal ColumnNumber as Long) as String -------------------------------------------------------------------------- ------ which if I call must say: code:----------------------------------------------------------------------- --------- GetAlphabet(1) -------------------------------------------------------------------------- ------ Output: "A" |
#3
![]()
Posted to microsoft.public.excel.newusers,microsoft.public.excel.misc,microsoft.public.excel.programming
|
|||
|
|||
![]()
Try a function like the following:
Function ColLetter(ColNumber As Integer) As String ColLetter = Left(Cells(1, ColNumber).Address(False, False), _ 1 - (ColNumber 26)) End Function -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Sathyaish" wrote in message om... Is there some function in Excel (VBA) that will get me the column alphabet if I provide the column number, or do I have to write one. I ask because I know that there is, yet I recall I wrote this functionality for the previous application, and I don't want to: (1) Reuse it, if there's something in-built (2) Re-invent the wheel Help! PS: I'm looking for something like: code:----------------------------------------------------------------------- --------- Function GetAlphabet(ByVal ColumnNumber as Long) as String -------------------------------------------------------------------------- ------ which if I call must say: code:----------------------------------------------------------------------- --------- GetAlphabet(1) -------------------------------------------------------------------------- ------ Output: "A" |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Return column number from column header text | Excel Discussion (Misc queries) | |||
How can I vary the row number or column alphabet depending on my n | Excel Discussion (Misc queries) | |||
Excel check one column for highlighting and return number | Excel Discussion (Misc queries) | |||
How can I fill in a column with the alphabet | Excel Discussion (Misc queries) | |||
replacing column alphabet | Excel Programming |