LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default UDF Looks for Named Range Not Function

Strange Problem Here...

I had a cell that created a job number using some very long formulas to
check the folder path where the spreadsheet was stored and parse out a job
number. I had named the cell "JobNum". In other cells where I wanted the
job number to show I would enter "=JobNum". This worked fine but the cell
method was very cumbersome and so I changed it to use a UDF in VBA. The user
defined function is "Public Function JobNum()". For the cell to call the
function, I first have to delete the named range "JobNum" via
Insert|Name|Define menu, then I change the formula in the cell from "=JobNum"
to "=JobNum()". This has worked fine for many spreadsheets that I have
updated to use the VBA method instead of the cell method. However, today I
opened up a spreadsheet that I had not yet updated, deleted the name
(JobNum), imported the module that has the "JobNum" function (like I have
done many times) and changed the fromula to "=JobNum()". This time however I
get a €ś#Name?€ť error in the cell that calls the "JobNum()" function. I have
triple checked that I have deleted the cell name correctly. There are no
other worksheets in the file (at least that I can see from the tabs or from
VBA project window). Furthermore, when I "evaluate" formula on a "=Today()"
function that is in the spreadsheet, it initially shows the entire function
underlined including the "()" before it evaluates it. However, when I
evaluate the "=JobNum()" function only the "JobNum" part is underlined (and
not the parenthesis) which leads me to believe that the spreadsheet still
thinks "JobNum" is a named range. I have put a stop in my VBA code and
verified that the UDF is never even called. (If I change both the cell
formula and function name to €śJobNum1()€ť it works fine, however I am
interested in solving this problem and also in keeping this method consistent
with the many other spreadsheets that use this UDF.)

I've tried everything I can think of. Does anyone have any ideas?

Thanks in Advance
 
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
Passing a named range to a function Mike M 91107 Excel Programming 1 December 23rd 08 08:17 PM
can't use function 'countif' in named range Roland Excel Discussion (Misc queries) 9 November 5th 08 08:29 PM
can't use function 'countif' in named range Roland Excel Worksheet Functions 3 November 4th 08 12:13 PM
Named Range references in function formulas Bob Excel Worksheet Functions 1 March 11th 08 04:21 PM
dynamic named range function MJB Excel Worksheet Functions 1 August 5th 05 05:56 AM


All times are GMT +1. The time now is 12:15 PM.

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"