+ Reply to Thread
Results 1 to 4 of 4

IF Error Macro

  1. #1
    Registered User
    Join Date
    12-11-2018
    Location
    Boston, MA
    MS-Off Ver
    Windows 10
    Posts
    4

    IF Error Macro

    I'm trying to run a macro that will add an IFERROR to all formulae in an entire Excel workbook so that it will get rid of all the #ref! errors. The #ref! is happening because many of the formulae are looking for information in pivot charts that has not yet been created, which I am aware of. The macro that I am using is below and the error message is in the .png file. Any help as to what needs to be edited to get this to run properly. The desired end result is to wrap my formulas in IFERROR that returns a blank cell.
    Function loopThroughRange(r As Range)

    Please Login or Register  to view this content.
    Function loopThroughRange.docx

  2. #2
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: IF Error Macro

    I didn't evaulate your code to see if you were trying to do anything else with it as well, this will add the IFERROR function to any formula that currently returns #REF
    Please Login or Register  to view this content.
    I've assumed that you might have some array formulas in your workbook and that you want to leave any other errors, #VALUE!, #NUM!, #DIV/0!, #NAME? and #NULL! in place for troubleshooting purposes.

  3. #3
    Registered User
    Join Date
    12-11-2018
    Location
    Boston, MA
    MS-Off Ver
    Windows 10
    Posts
    4

    Re: IF Error Macro

    I've inserted this code and it's returning an error. The yellow portion is what seems to be the issue. Did I miss something? VBA/macro newbie over here. Thanks again!


    Macro Error 2.PNG

  4. #4
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: IF Error Macro

    Sorry, that was my bad!

    A worksheet with no errors of any kind will cause that, this will force past it. As before, this will only clear #REF! errors, all other errors will remain in place.

    Please Login or Register  to view this content.

+ 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] Macro To IGNORE ERROR - Cell With Formula / Green Arrow Error
    By Logit in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-06-2018, 09:16 PM
  2. [SOLVED] Sort Macro Run-time error '1004': Application/Object-defined error.
    By sam1212 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-22-2014, 10:05 AM
  3. MACRO ERROR WITH EXCEL 2013 - Run-Time Error '-2147417848 (80010108)'
    By graiggoriz in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-29-2014, 11:07 AM
  4. Excel macro (compile error. syntax error.) error
    By salar_younis in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-06-2014, 06:11 AM
  5. [SOLVED] Simple Calendar pop up macro --> error Run-time error '424': Object required
    By am_hawk in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-11-2013, 10:38 AM
  6. Print Macro / module error & Update / Clear Macro error
    By mal.b.graham in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 09-28-2012, 06:40 PM
  7. [SOLVED] Macro error - Run time error 1004 (App defined/Object Defined error)
    By jlax34 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-06-2012, 03:02 PM

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