Column() convert to letter (A1 notation)

John Kauffman

New Member
Joined
Oct 13, 2011
Messages
23
Is there a way to get the column letter (in A1 notation) of the active cell, as opposed to its number (from R1C1 notation).

=ADDRESS(5,10,4 ) returns row and col in A1 notation, but getting just col is a parse job

My sources of column number (R1C1)
Formula: =Column()
Code: MsgBOx("active column is " & activecell.column())
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Scott:
Thanks for quick response.

The question is how to get only the column address in A1 notation.
I'm comfortable getting the entire address with either:
Activecell.address
or
Address(...)

Thanks, John
 
Upvote 0
Is there a way to get the column letter (in A1 notation) of the active cell, as opposed to its number (from R1C1 notation).

=ADDRESS(5,10,4 ) returns row and col in A1 notation, but getting just col is a parse job

My sources of column number (R1C1)
Formula: =Column()
Code: MsgBOx("active column is " & activecell.column())

You can use the Cell function ("address") changing all (find and replace function) except the A1 notation
 
Upvote 0
Try this:
Code:
Sub GetColAdr()
Dim Adr As String, cAdr As String
With ActiveCell
    Adr = .Address
    For i = 1 To Len(Adr)
        If Not IsNumeric(Mid(Adr, i, 1)) Then cAdr = cAdr & Mid(Adr, i, 1)
    Next i
End With
MsgBox "Activecell is in column " & Mid(cAdr, 2, Len(cAdr) - 2)
End Sub
 
Upvote 0
Hi John

You can get the column in A1 notation, but why do you want to do it?

Code:
MsgBox Split(ActiveCell.Address, "$")(1)
 
Upvote 0
Thanks to both.
MoJoe - I was headed down your route; thanks for working code to which I can compare my parsing / conversion.
Pgc - brilliant & you introduced me to a whole new function

Will be used to report to user the col that has changed.
 
Upvote 0

Forum statistics

Threads
1,214,547
Messages
6,120,139
Members
448,948
Latest member
spamiki

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top