View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Jean Jean is offline
external usenet poster
 
Posts: 4
Default 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