+ Reply to Thread
Results 1 to 5 of 5

IsError() crashes if there is an error

  1. #1
    Registered User
    Join Date
    11-14-2019
    Location
    Finland
    MS-Off Ver
    2016
    Posts
    32

    IsError() crashes if there is an error

    Hi, I have a problem.
    The relevant part here is that
    Please Login or Register  to view this content.
    in my code works as long as there is no error finding a match. If no match is found, the code crashes.


    This is the whole function

    Please Login or Register  to view this content.
    The code is supposed to add a text from cell A2 next to each entry of "Mallit" column B that is found in "Putket" column A.
    So basically the function says: If found match then add the text next to match. If not found, copy the matchless data to cell next to it. Simple right?

    I've now deleted the actual functions from the part where an error is found and simply replaced it with a debug msgbox. I don't see the msgbox, instead before that I get "Unable to get the Match property of Worksheetfunction class"
    The code does all it's supposed to until the first matchless cell

  2. #2
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,027

    Re: IsError() crashes if there is an error

    You need to remove the WorksheetFunction part so it reads
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    11-14-2019
    Location
    Finland
    MS-Off Ver
    2016
    Posts
    32

    Re: IsError() crashes if there is an error

    Quote Originally Posted by Fluff13 View Post
    You need to remove the WorksheetFunction part so it reads
    Please Login or Register  to view this content.
    This worked, thank you

  4. #4
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: IsError() crashes if there is an error

    Also when using a variable with Application.Match always declare it as Variant because it must be able to hold a value but also an error.

    So in your code the x needs to be Variant, not Integer otherwise your code will go into Debug.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  5. #5
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,027

    Re: IsError() crashes if there is an error

    Quote Originally Posted by Jupsu View Post
    This worked, thank you
    You're welcome & thanks for the feedback

+ 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. [SOLVED] IsError... error?
    By JasonLeisemann in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-17-2015, 12:02 PM
  2. On Error GoTo - something crashes
    By VitoBdG in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-10-2014, 09:08 AM
  3. IFERROR and nested ISERROR with different error messages or non at all
    By metalray in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-26-2014, 11:16 AM
  4. Replies: 1
    Last Post: 12-15-2011, 08:43 PM
  5. IF(ISERROR) error excel 2003
    By hugrl in forum Excel General
    Replies: 10
    Last Post: 01-29-2011, 04:56 PM
  6. Add ISERROR to resolve DIV/0 error
    By mtntxn in forum Excel General
    Replies: 2
    Last Post: 09-28-2009, 04:58 AM
  7. error in formula using ISERROR
    By carsto in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-15-2006, 04:03 PM

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