Column letter
Ivan F Moala
Google
Can Do
Visits here
Goto Guest book sign in page [Home]
Greatest place to be
Thanks for visiting my site lucky visitor:
This page was last updated on: April 25, 2006
Copyright © 2002. XcelFiles. All Rights Reserved Ivan F Moala
Tell a friend about this page
If you ever wanted to get the column letter of a cell address then here's a simple routine that does this.
'// gets Activecell column letter


Sub GetColumnLetter()
Dim MyColumn As String, Here As String

'// Get the address of the active cell in the current selection.
Const msg = "The column letters @ "

Here = ActiveCell.Address

'// Note Address format is $<columnletter>$<rownumber>,
'// so drop the first character and the characters
'// after the column letter(s).
MyColumn = Mid(Here, InStr(Here, "$") + 1, InStr(2, Here, "$") - 2)
'// Show the result
MsgBox msg & Here & ":= " & MyColumn

End Sub