Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Debug.Print Selection.SpecialCells(xlCellTypeLastCell).Column produces a
column NUMBER. How do I get back instead, or convert that to, the letter portion of the column label in A1 format? e.g. the last active cell is "Z42" The above code returns 26. I need it to return "Z". |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I do the following:
dim iColumn as integer, sColumn as String iColumn=26 sColumn = Chr(iColumn + 64) "Bill Sturdevant" wrote: Debug.Print Selection.SpecialCells(xlCellTypeLastCell).Column produces a column NUMBER. How do I get back instead, or convert that to, the letter portion of the column label in A1 format? e.g. the last active cell is "Z42" The above code returns 26. I need it to return "Z". |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
But, if the last column is "DJ", my code returns 114. The proposed solution
below does not handle that. "Tony_VBACoder" wrote: I do the following: dim iColumn as integer, sColumn as String iColumn=26 sColumn = Chr(iColumn + 64) "Bill Sturdevant" wrote: Debug.Print Selection.SpecialCells(xlCellTypeLastCell).Column produces a column NUMBER. How do I get back instead, or convert that to, the letter portion of the column label in A1 format? e.g. the last active cell is "Z42" The above code returns 26. I need it to return "Z". |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
try temp = ActiveCell.Address to get you started
|
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Bill,
If you use: Debug.Print Selection.SpecialCells(xlCellTypeLastCell).Address (False, False) It will return: A1 If you use: Debug.Print Selection.SpecialCells(xlCellTypeLastCell).Address It will return: $A$1 HTH--Lonnie M. |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thank you! We are almost there! What I am really trying to get is the "A"
in the "A1"! "Lonnie M." wrote: Hi Bill, If you use: Debug.Print Selection.SpecialCells(xlCellTypeLastCell).Address (False, False) It will return: A1 If you use: Debug.Print Selection.SpecialCells(xlCellTypeLastCell).Address It will return: $A$1 HTH--Lonnie M. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Question on this conversion code switching between r1c1 to A1 format tia sal2 | Excel Worksheet Functions | |||
Question on this conversion code switching between r1c1 to A1 format tia sal2 | Excel Discussion (Misc queries) | |||
R1C1 versus A1 | New Users to Excel | |||
What's wrong with this code (r1c1 paste) | Excel Programming | |||
Converting code to R1C1 format | Excel Programming |