+ Reply to Thread
Results 1 to 5 of 5

Vba code to check if there are formula errors and put them in a variable

  1. #1
    Forum Contributor
    Join Date
    07-26-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2016 Office 365 ProPlus
    Posts
    822

    Vba code to check if there are formula errors and put them in a variable

    So is there a simple way (without having to code an entire extra module) to 'capture' if there are #NA errors on a sheet.

    Its like this.
    I have a code which also opens a conversion worksheet and then the formulas update.
    However if this conversion sheet is not complete or up to date the output will have "#NA" in some cells.

    Not a big deal because the user can check and update the conversion and run the macro again.
    However i would like to provide some sort of headsup at the end of the macro.

    So a msgbox to not only state that the macro is done but also that there are NA's which they need to fix.
    Depending if there are NA's the end message will be different (Al ok or update your conversion).

  2. #2
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Vba code to check if there are formula errors and put them in a variable

    Hi,

    You may use a simple Countif calculation

    Please Login or Register  to view this content.
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  3. #3
    Forum Contributor
    Join Date
    07-26-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2016 Office 365 ProPlus
    Posts
    822

    Re: Vba code to check if there are formula errors and put them in a variable

    Good suggestion!
    Did a quick test for this and could work.

    However how can I get it in some sort of a variable?

    At the end of the VBA code it should check this variable and if there are error it should generate a different text in the msgbox than when there are no errors.

  4. #4
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Vba code to check if there are formula errors and put them in a variable

    Thus
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    07-26-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2016 Office 365 ProPlus
    Posts
    822

    Re: Vba code to check if there are formula errors and put them in a variable

    Ah superb!
    This I should be able to incorporate in my main code.
    Thanks!

+ 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. How to check if excel file is Checked Out in SharePoing Check Out, run code, Check In
    By jrtraylor in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-08-2016, 04:36 PM
  2. [SOLVED] check the value of a variable in code
    By ammartino44 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-17-2015, 05:50 PM
  3. [SOLVED] Formula to check if a Multi-Cell Range contains any errors
    By Masa1989 in forum Excel General
    Replies: 3
    Last Post: 07-21-2015, 11:58 PM
  4. Vlookup Formula With 2 Variable To Check
    By astronotbumi in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 11-23-2014, 10:06 AM
  5. [SOLVED] Need Excel 2007 Formula to Check For Accounting Errors in Long Column
    By alcharbonneau in forum Excel General
    Replies: 4
    Last Post: 09-14-2012, 06:16 AM
  6. [SOLVED] Check for errors
    By Pat in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-24-2005, 03:06 PM
  7. [SOLVED] Check for errors
    By Pat in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 01-30-2005, 09:06 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