View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
Rick Rothstein \(MVP - VB\)[_1934_] Rick Rothstein \(MVP - VB\)[_1934_] is offline
external usenet poster
 
Posts: 1
Default Extracting Column Letter

XL2007 has over 16000 columns available, so your code would only return the
first two letters for Columns AAA through XFD.

Rick


"Gary''s Student" wrote in message
...
Why not 2007??
--
Gary''s Student - gsnu200786


"Rick Rothstein (MVP - VB)" wrote:

Provided he isn't using XL2007, of course.<g

Rick


"Gary''s Student" wrote in
message
...
If you ever need to do this in the worksheet:

=SUBSTITUTE((LEFT(ADDRESS(1,COLUMN()),3)),"$","")

--
Gary''s Student - gsnu200786


"Rob" wrote:

Hello All,

I am trying to extract and use the column letter instead of the
number.
My
code looks something like this:

Dim StrLastColumn as String

strLastColumn = ActiveCell.Column

The problem with this is that the .Column property returns the number
not
the letter. So, if I am in column Z I get 26 instead of Z. I really
need Z.

Any thoughts?

Rob