Get Column Letter

  • Thread starter Thread starter BB Ivan
  • Start date Start date
B

BB Ivan

In a procedure, how can I get the letter of a referenced column rather than
it's number?
 
Thanks. I was hoping there was a property not listed in the Help Files, but
this works great.
 
In a procedure, call this function.

Function GetColLet(ColNumber As Integer) As String
GetColLet = Left(Cells(1, ColNumber).Address(False, False), _
1 - (ColNumber > 26))
End Function

Sub test()
MsgBox "this is column " & GetColLet(ActiveCell.Column)
End Sub


Gord Dibben MS Excel MVP
 
Only works up to column Z.

Right... my bad.

(I cancelled the article after posting it, but apparently it escaped into
the world anyhow. Next time, I'll post a retraction too.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top