View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Bob Phillips
 
Posts: n/a
Default How to extract just the Column Name of the active cell


Debug.Print ColumnLetter(activecell.Column)


'-----------------------------------------------------------------
Function ColumnLetter(Col As Long)
'-----------------------------------------------------------------
Dim sColumn As String
On Error Resume Next
sColumn = Split(Columns(Col).Address(, False), ":")(1)
On Error GoTo 0
ColumnLetter = sColumn
End Function

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Fred" wrote in message
...
Hello,
Does anyone know how to extract only the Column Name of an active cell

in
another cell. e.g. If active cell is D4 then I want the "D" to be extract

and
displayed in another cell say A1. Let me know.

Regards,
Fred