+ Reply to Thread
Results 1 to 4 of 4

Query on UDF - #VALUE error

  1. #1
    Registered User
    Join Date
    10-26-2011
    Location
    New Delhi, India
    MS-Off Ver
    Excel 2007
    Posts
    3

    Query on UDF - #VALUE error

    Hi all

    I have a UDF that I wrote to calculate results for teams in a tournament based on the results of the opponents they have played.

    The UDF is returning a #VALUE error and I can't figure out why. I also tried to find the exact line with the error using MsgBox, but the function apparently does not even start executing, as I never get a single MsgBox output.

    Pasting my UDF code below (with the MsgBox commands commented out). Can someone please help and let me know where I am going wrong? This is a little urgent as the tournament (where I want to use this excel) is this weekend.

    Thanks
    Sid

    Please Login or Register  to view this content.
    Last edited by rsiddharth1985; 10-26-2011 at 05:24 PM.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,371

    Re: Query on UDF - #VALUE error

    Be good to see it in the context of a sample workbook with examples of how it is called.

    Not sure how well a message box works in a function ... that might be part of the problem.

    Use Debug.Print to track progress and show the contents of variables.

    Regards
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    10-26-2011
    Location
    New Delhi, India
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Query on UDF - #VALUE error

    Hi TMShucks and others

    Thanks for the response. I think I figured out the issue.. The MsgBox commands were the problem, apart from me using the .Cells.Value property, where only .Cells would have sufficed.

    I've got it up and running now, thanks a lot. Just very frustrating, ironic and funny that the very MsgBox commands that I had put in to debug the function were the cause of the problem in the first place :-)

    Cheers, and really positively surprised with the speed of query resolution on this Board.. Love it.. Will try to be an active contributor to the extent I can.

    Thanks again
    Sid

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,371

    Re: Query on UDF - #VALUE error

    You're welcome.

    If this has answered your question, please mark your thread as solved. See my signature for details or the FAQ.

    regards

+ 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