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())
 

John Kauffman

New Member
Joined
Oct 13, 2011
Messages
23
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
 

Ver101

Board Regular
Joined
Sep 2, 2011
Messages
190
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
 

Ver101

Board Regular
Joined
Sep 2, 2011
Messages
190
You can use the Cell function ("address") changing all (find and replace function) except the A1 notation
You can also used Address function removing excess through find and replace
 

JoeMo

MrExcel MVP
Joined
May 26, 2009
Messages
16,666
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
 

pgc01

MrExcel MVP
Joined
Apr 25, 2006
Messages
19,752
Hi John

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

Code:
MsgBox Split(ActiveCell.Address, "$")(1)
 

John Kauffman

New Member
Joined
Oct 13, 2011
Messages
23
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.
 

Forum statistics

Threads
1,082,323
Messages
5,364,594
Members
400,808
Latest member
formulasataglance

Some videos you may like

This Week's Hot Topics

  • populate from drop list with multiple tables
    Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
  • Find list of words from sheet2 in sheet1 before a comma and extract text vba
    Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
  • Dynamic Formula entry - VBA code sought
    Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...
Top