Re: how get column letter from range?

Tech-Archive recommends: Speed Up your PC by fixing your registry




Hello Ian,

Here is a function that doesn't care about the dollar signs.

Public Function ColumnLetter(ByRef Rng As Excel.Range)

Dim ColLtr1 As String
Dim ColLtr2 As String
Dim X

X = Rng.Address(False, False)
ColLtr1 = Left(X, 1)
ColLtr2 = Mid(X, 2, 1)

If Val(ColLtr2) = 0 Then ColLtr1 = ColLtr1 & ColLtr2

ColumnLetter = ColLtr1

End Function

Sincerely,
Leith Ross


--
Leith Ross
------------------------------------------------------------------------
Leith Ross's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=18465
View this thread: http://www.excelforum.com/showthread.php?threadid=491287

.