Closed Thread
Results 1 to 5 of 5

UDF help

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    02-18-2013
    Location
    canada
    MS-Off Ver
    Excel 2003
    Posts
    112

    UDF help

    Hi. I created my own UDF with the below code. Everytime I use the functions, like =Compare2Num(L5,N5), I get #NAME?. Can anybody help me pinpoint the issue? Thank you very much in advance.


    Note : L5 and N5 can be decimal numbers like 1.8 and 0.779 respectively


    Function Compare2Num(ByVal num1 As Variant, num2 As Variant) As String
    
    If (num1 < num2) Then
        Compare2Num = "<"
    ElseIf (num1 > num2) Then
        Compare2Num = ">"
    Else
        Compare2Num = "="
    End If
    
    End Function
    Last edited by itselflearn; 02-27-2016 at 09:30 AM.

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,637

    Re: UDF help

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution.

    Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.

    To change a Title go to your first post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)

  3. #3
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,637

    Re: UDF help

    #NAME indicates that function is not recognizable.
    Did you copy your core into THAT workbook?

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

    Re: UDF help

    zbor. This looks like a duplicate thread, and the issue seems resolved: http://www.excelforum.com/excel-prog...ame-error.html
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  5. #5
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,637

    Re: UDF help

    Thank you MrShorty!

    This is a duplicate post and as such does not comply with Rule 5 of our forum rules. This thread will now be closed, you may continue in your other thread.

    http://www.excelforum.com/excel-prog...ame-error.html

    Thread Closed.

Closed 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