How to determine the column letter from Cell address
Thanks everyone.
"Greg Wilson" wrote in message
...
Since the column letter can be AA, AB etc. it's not entirely simple. This
should do:
Sub Test()
MsgBox GetColLetter(ActiveCell)
End Sub
Function GetColLetter(c As Range) As String
Dim txt As String
txt = c.EntireColumn.Address(0, 0)
GetColLetter = Left(txt, InStr(txt, ":") - 1)
End Function
Regards,
Greg
"Jean" wrote:
Hi,
If there a function in VBA that return the column letter from a given
cell
address ? For example, I need to know the that the column letter for
Cell(7,1) is G.
Thanks
JH
|