+ Reply to Thread
Results 1 to 5 of 5

#Name Error on User Defined Function

  1. #1
    Registered User
    Join Date
    11-07-2012
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    8

    #Name Error on User Defined Function

    I am having the same issue as the user that posted this thread:

    Excel 2007 : #Name? on Excel 2007 user defined function

    I have a UDF that works consistently (been using it for a few weeks). Then, all of the sudden, I will open the spreadsheet, enable macros, and the UDF will return #NAME in all cells it applies too. Other UDF's still work and I tried the solution in the linked thread. The msgbox appears so I know that the macros are enabled. If I change the name of the UDF and change it in all the cells it works again. However, this is super annoying. . .

  2. #2
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: #Name Error on User Defined Function

    Is it in a module and have you declared it as public?

  3. #3
    Registered User
    Join Date
    11-07-2012
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: #Name Error on User Defined Function

    Yes to both. As I said, up until today it had worked fine.

  4. #4
    Registered User
    Join Date
    11-07-2012
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: #Name Error on User Defined Function

    Ok, so I figured out that the error is stemming from when I name the module in the properties window of VBA (F4). How can I name the module and have the spreadsheet still be able to find it?

  5. #5
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,829

    Re: #Name Error on User Defined Function

    I have never had trouble naming a module, unless I used a reserved name, or used the same name for the module as for one of the functions. If it seems related to naming the module, make sure you aren't creating some kind of name conflict.

+ 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