+ Reply to Thread
Results 1 to 10 of 10

Why does IsError return #value

  1. #1
    Registered User
    Join Date
    01-07-2020
    Location
    Morton, Illinois, USA
    MS-Off Ver
    365 Business
    Posts
    6

    Why does IsError return #value

    For some reason my use defined function udf_tf that uses IsError returns #value. See attachment.
    Attached Files Attached Files

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Why does IsError return #value

    Maybe instead

    Please Login or Register  to view this content.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Forum Guru
    Join Date
    04-23-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 365
    Posts
    2,408

    Re: Why does IsError return #value

    @Richard Buttrey,

    If your UDF does what the OP wants, then I believe this one should as well...
    Please Login or Register  to view this content.

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Why does IsError return #value

    Thanks Rick...even better

  5. #5
    Registered User
    Join Date
    01-07-2020
    Location
    Morton, Illinois, USA
    MS-Off Ver
    365 Business
    Posts
    6

    Re: Why does IsError return #value

    Rick/Rich - Thanks guys! Hmmm. Unfortunately, neither worked. Not sure why not. Both are always TRUE. See attached.
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    01-07-2020
    Location
    Morton, Illinois, USA
    MS-Off Ver
    365 Business
    Posts
    6

    Re: Why does IsError return #value

    Ope! Arguments to InStr were backwards. Thanks for the solution guys!

    Side question, I've got some coding experience, but I'm new to VBA and new to VBA in the Excel platform. Question 1: All I know about are normal in-cell Excel functions. What is the story with VBA only Excel functions like "InStr()"? Question 2: You know of any general tutorials or references that would help me to learn?

    Thanks again guys for the quick reply and awesome solution. You guys are the best!!

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

    Re: Why does IsError return #value

    I find these two references useful:

    VBA language reference with information about VBA statements, functions, keywords, etc. https://docs.microsoft.com/en-us/off...uage-reference

    Since most uses of VBA (in this forum) are interacting with Excel, this documents the object model for Excel: https://docs.microsoft.com/en-us/off...l/object-model
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  8. #8
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Why does IsError return #value

    The syntax for the various VBA instructions can be found in the VBE and hitting F2 to bring up the Object Browser (or View Obect Browser)

    Click the VBA option in the top dropdown and you'll see all the instuctions in the 'Members' pane. You can further filter these with the Classes pane, so for instance selecting the Strings class you'll see all the instructions that you can use for strings of data.

    As for learning, well of course everyone is different. I used two books

    Excel 2000 VBA Programmers Reference Guide but of course this has been updated in the last 20 years and later versions are available. I don't believe that VBA (unlike Excel itself) has changed much if at all over the period. ISBN 1-861002-54-8

    The other was 'Writing Excel Macros with VBA' by Steven Roman ISBN 1-56592-587-4

    If you google particular requirements including the words Excel & VBA you'll find many sites that contain stuff that you'll find useful, many also have videos.

    The other way of course is to watch this forum and note the sorts of questions people ask and the development of the answer. Try following the suggestions yourself and play around with modifying code to see what happens.

    Important things to remember.
    In Excel avoid merged cells. Trying to handle merged cells with VBA can be a nusiance and you'll get unexpected results.
    In Excel always use range names, preferably dynamic names that change automatically to cover ranges that expand or contract over time, and use the names in VBA rather than A1 type cell references.

    Hope this helps a little

  9. #9
    Registered User
    Join Date
    01-07-2020
    Location
    Morton, Illinois, USA
    MS-Off Ver
    365 Business
    Posts
    6

    Re: Why does IsError return #value

    Thanks again guys, I will have a look at the references. Anything I should do to close out this thread? I didn't see any likes, votes, or solution markers.

  10. #10
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Why does IsError return #value

    Here's the text of the standard requirement.


    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

    Also, as a relatively new member of the forum, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Out, Return and Used. IF, ISERROR & MATCH?
    By bobbieatendido in forum Excel General
    Replies: 7
    Last Post: 02-13-2019, 11:27 PM
  2. [SOLVED] ISERROR return false when isn't
    By douglascaixeta in forum Excel Formulas & Functions
    Replies: 20
    Last Post: 12-04-2014, 01:06 PM
  3. Replies: 1
    Last Post: 12-15-2011, 08:43 PM
  4. How to Use IsError input if IsError=false
    By izpinoza in forum Excel General
    Replies: 1
    Last Post: 10-14-2009, 05:02 AM
  5. iserror
    By Duke Carey in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-06-2005, 07:05 PM
  6. [SOLVED] iserror
    By Bill R in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 10:05 AM
  7. iserror
    By Bill R in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 AM

Tags for this Thread

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