#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


  #2   Report Post  
Hank Scorpio
 
Posts: n/a
Default

On Sat, 23 Apr 2005 05:46:45 -0400, "Jim May" wrote:

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


Best guess; you have the function definitions in a different workbook
from the workbook that you have the formulas in.

If the functions below are in your Personal.xls workbook (say), then
this:
=PERSONAL.XLS!ColumnLetter(AC15)

should work, but this:
=ColumnLetter(AB5)

gives me the result you describe.

You might also consider saving the functions into an add-in. (.xla)

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



---------------------------------------------------------
Hank Scorpio
scorpionet who hates spam is at iprimus.com.au (You know what to do.)
* Please keep all replies in this Newsgroup. Thanks! *
  #3   Report Post  
Jim May
 
Posts: n/a
Default

Hank - Thanks,,,
CRAP!! -- I had them both in my Sheet1 module
versus a Standard Module..
Thanks,
Jim


"Hank Scorpio" wrote in message
...
On Sat, 23 Apr 2005 05:46:45 -0400, "Jim May" wrote:

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


Best guess; you have the function definitions in a different workbook
from the workbook that you have the formulas in.

If the functions below are in your Personal.xls workbook (say), then
this:
=PERSONAL.XLS!ColumnLetter(AC15)

should work, but this:
=ColumnLetter(AB5)

gives me the result you describe.

You might also consider saving the functions into an add-in. (.xla)

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



---------------------------------------------------------
Hank Scorpio
scorpionet who hates spam is at iprimus.com.au (You know what to do.)
* Please keep all replies in this Newsgroup. Thanks! *



  #4   Report Post  
Bob Phillips
 
Posts: n/a
Default

Hi Jim,

Another version for you :-)

Function ColumnLetter(rng As Range) As String
ColumnLetter = Split(Columns(rng.Column).Address(, False), ":")(1)
End Function


--

HTH

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


"Jim May" wrote in message
news:v5pae.26134$gV.17101@lakeread02...
Hank - Thanks,,,
CRAP!! -- I had them both in my Sheet1 module
versus a Standard Module..
Thanks,
Jim


"Hank Scorpio" wrote in message
...
On Sat, 23 Apr 2005 05:46:45 -0400, "Jim May" wrote:

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


Best guess; you have the function definitions in a different workbook
from the workbook that you have the formulas in.

If the functions below are in your Personal.xls workbook (say), then
this:
=PERSONAL.XLS!ColumnLetter(AC15)

should work, but this:
=ColumnLetter(AB5)

gives me the result you describe.

You might also consider saving the functions into an add-in. (.xla)

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



---------------------------------------------------------
Hank Scorpio
scorpionet who hates spam is at iprimus.com.au (You know what to do.)
* Please keep all replies in this Newsgroup. Thanks! *





  #5   Report Post  
Jim May
 
Posts: n/a
Default

Thanks Bob, I've added it to my file(s).
Jim

"Bob Phillips" wrote in message
...
Hi Jim,

Another version for you :-)

Function ColumnLetter(rng As Range) As String
ColumnLetter = Split(Columns(rng.Column).Address(, False), ":")(1)
End Function


--

HTH

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


"Jim May" wrote in message
news:v5pae.26134$gV.17101@lakeread02...
Hank - Thanks,,,
CRAP!! -- I had them both in my Sheet1 module
versus a Standard Module..
Thanks,
Jim


"Hank Scorpio" wrote in message
...
On Sat, 23 Apr 2005 05:46:45 -0400, "Jim May" wrote:

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

Best guess; you have the function definitions in a different workbook
from the workbook that you have the formulas in.

If the functions below are in your Personal.xls workbook (say), then
this:
=PERSONAL.XLS!ColumnLetter(AC15)

should work, but this:
=ColumnLetter(AB5)

gives me the result you describe.

You might also consider saving the functions into an add-in. (.xla)

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


---------------------------------------------------------
Hank Scorpio
scorpionet who hates spam is at iprimus.com.au (You know what to do.)
* Please keep all replies in this Newsgroup. Thanks! *







Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Producing Avery labels in Excel Anthony Excel Discussion (Misc queries) 1 April 8th 05 04:34 PM
Need help producing simple sales figures Mark_King Excel Discussion (Misc queries) 3 March 16th 05 09:01 PM


All times are GMT +1. The time now is 03:12 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"