View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Greg Wilson Greg Wilson is offline
external usenet poster
 
Posts: 747
Default How to determine the column letter from Cell address

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