Results 1 to 2 of 2

Thread: UDF and #NAME?

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2005
    Posts
    1,069

    UDF and #NAME?

    Hello
    In this legacy spreadsheet
    I have got the following UDF defined in a module.

    Function nb_antenna(nb_sectors As Double) As Double

    nb_antenna = 2 * nb_sectors

    End Function


    now in one of the worksheets, i have in G6 nb_antenna(D6)
    and in D6 i have the value 1

    which gives a value of 2 in G6

    this is the legacy stuff

    now when i change 1 to 2 it comes up with #NAME?

    I thought it had something to do with security, and i changed the macro settings to the lowest. (what nasties should i be watching out for when i do this?)

    but no dice(perhaps i am not doing the security setting change correctly

  2. #2
    Addicted Member
    Join Date
    Aug 2002
    Location
    Luton, UK
    Posts
    178

    Re: UDF and #NAME?

    Can't see anything wrong with the code. The error #NAME usually means that the formula cannot find the function name.

    Try putting the word Public before the function in the module to make it Public Function nb_antenna ... etc.

    Make sure the function name is spelled correctly in the sheet.
    Regards
    BrianB
    -------------------------------

Posting Permissions

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



Click Here to Expand Forum to Full Width