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.)
 
Back
Top