View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Bill Sturdevant[_2_] Bill Sturdevant[_2_] is offline
external usenet poster
 
Posts: 17
Default R1C1 versus A1 in VB code

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".