Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
character representation of specific column
Dear all,
Is there a simple way in VBA to get the character representation of specific column? For example, activesheet.cells(1, 2) = row = 1, column = "B" I guess using chr(activesheet.cells(1, 2).column + 64) could do the job from "A" to "Z". How about "AA"...? Thanks in advance! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
character representation of specific column
================================================== =
' Jun 08, 2002 - Created - Thanks to Chip Pearson ' Jim Cone - San Francisco, USA ' Returns the address of the column from the provided column number. '================================================= == Function GetColumnLetters(ByVal ColumnNum As Long) As String On Error GoTo NoColumn Dim ColChars As String ColChars = Columns(ColumnNum).Address(False, False) GetColumnLetters = Left$(ColChars, 2 + CBool(ColumnNum < 27)) '2 + 0 or 2 + (-1) Exit Function NoColumn: Beep GetColumnLetters = vbNullString End Function '================================================= == "KS Wong" wrote in message ... Dear all, Is there a simple way in VBA to get the character representation of specific column? For example, activesheet.cells(1, 2) = row = 1, column = "B" I guess using chr(activesheet.cells(1, 2).column + 64) could do the job from "A" to "Z". How about "AA"...? Thanks in advance! |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
character representation of specific column
Thanks a lot, Jim
"Jim Cone" wrote: ================================================== = ' Jun 08, 2002 - Created - Thanks to Chip Pearson ' Jim Cone - San Francisco, USA ' Returns the address of the column from the provided column number. '================================================= == Function GetColumnLetters(ByVal ColumnNum As Long) As String On Error GoTo NoColumn Dim ColChars As String ColChars = Columns(ColumnNum).Address(False, False) GetColumnLetters = Left$(ColChars, 2 + CBool(ColumnNum < 27)) '2 + 0 or 2 + (-1) Exit Function NoColumn: Beep GetColumnLetters = vbNullString End Function '================================================= == "KS Wong" wrote in message ... Dear all, Is there a simple way in VBA to get the character representation of specific column? For example, activesheet.cells(1, 2) = row = 1, column = "B" I guess using chr(activesheet.cells(1, 2).column + 64) could do the job from "A" to "Z". How about "AA"...? Thanks in advance! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Extracting characters before or after a specific character | Excel Worksheet Functions | |||
Filter with a specific character | Excel Discussion (Misc queries) | |||
Counting a Specific Character | Excel Discussion (Misc queries) | |||
How I find specific character?? | Excel Worksheet Functions | |||
Counting Specific Character(s) In A Range? | Excel Discussion (Misc queries) |