+ Reply to Thread
Results 1 to 4 of 4

Unusual UDF Behaviour

  1. #1
    Registered User
    Join Date
    12-20-2007
    Posts
    10

    Unusual UDF Behaviour

    I'm new to UDfs in excel and I've stumbled across this problem a number of times now. When I create a Module containing a function, Excel will refuse to recognize it. It does not populate into the Excel list under 'User Defined Functions' and manually referencing the function anytime before this only results in a return of "#NAME?" to the cell i try to use the function in. Closing Excel and opening it does not do anything and i'm positive I'm calling my function correctly. After a few days of working in the file, Excel decides to acknowledge the functions I created (it will populate in the User Define funciton formula list) and everything will work. Sounds crazy. Is there a step between creating a UDF Module and calling it in your spreadsheet that I'm not aware of? Any thoughts as to what might be causing this?

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    Are macros enabled when you create the UDF?

  3. #3
    Registered User
    Join Date
    12-20-2007
    Posts
    10
    yup - macros are enabled.

  4. #4
    Forum Expert
    Join Date
    01-03-2006
    Location
    Waikato, New Zealand
    MS-Off Ver
    2010 @ work & 2007 @ home
    Posts
    2,243
    hi,

    Dave Ritchie's site suggests that "If you see #NAME! then your function is not found possibly misnamed":
    http://www.mvps.org/dmcritchie/excel...m#problems_udf

    These are unlikely but...
    *have you ended a macro before it finishes properly without resetting various settings (eg is calculation set to manual or are events disabled)?
    *is the udf code in a module of a separate file than what you are using the function in?
    *is the UDF function or module using a "Private" statement?
    (The exact impact of this varies depending on its position in the module.)

    Other useful sites with details about UDF's include:

    Charles Willam's Decison Models has the most detail I've seen:
    http://www.decisionmodels.com/calcsecretsj.htm

    http://www.ozgrid.com/VBA/Functions.htm

    http://www.mvps.org/dmcritchie/excel/install.htm

    If none of these sites help, can you post a zipped file with your UDF code & an example of its use in the file?


    hth
    Rob
    Rob Brockett
    Kiwi in the UK
    Always learning & the best way to learn is to experience...

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1