View Single Post
  #1   Report Post  
Jim May
 
Posts: n/a
Default UDF producing #NAME?

Both these functions are yielding/displaying the #NAME?
in cell A1 which contains either =ColumnLetter(AB5) or ColumnLetter($AB$5)
or
ColLetter(AB5) or ColLetter($AB$5)..
Any ideas as to why?
Thanks in Advance

Function ColumnLetter(Rng As Range) As String
ColumnLetter = Left(Rng.Range("A1").Address(True, False), _
InStr(1, Rng.Range("A1").Address(True, False), "$", 1) - 1)
End Function


Function ColLetter(Rng As Range) As String
ColLetter = Left(Rng.Address(False, False), _
1 - (Rng.Column 26))
End Function