PDA

View Full Version : get Column Letter



Djblois
04-08-2008, 12:53 PM
I know how to get the column number of the activecell but how do I get the column letter? is that possible?

mdmackillop
04-08-2008, 12:58 PM
Have a look at this KB item (http://www.vbaexpress.com/kb/getarticle.php?kb_id=218)

MikeO
04-08-2008, 12:59 PM
ColLetter = Mid(ActiveCell.Address, 2, InStrRev(ActiveCell.Address, "$") - 2)


Someone may know an easier way.

tstav
04-08-2008, 01:19 PM
How easier can it be MikeO than the one you provided? :thumb
This is just a teeny-tiny variation (in case anyone was caught by surprise with the instrrev)
Mid(ActiveCell.Address, 2, InStr(2, ActiveCell.Address, "$") - 2)

RichardSchollar
04-08-2008, 01:23 PM
Another option:

ColumnLetter = split(Activecell.address(true,false),"$")(0)

Richard

tstav
04-08-2008, 01:43 PM
Great idea Richard!!
colLetter = Split(ActiveCell.Address, "$")(1)

rory
04-08-2008, 02:37 PM
Why do you want it as a matter of interest?