+ Reply to Thread
Results 1 to 8 of 8

if cell is wrapped with IFERROR function, then delete the function from the cell

  1. #1
    Registered User
    Join Date
    11-28-2012
    Location
    Copenhagen
    MS-Off Ver
    Excel 2010
    Posts
    37

    if cell is wrapped with IFERROR function, then delete the function from the cell

    Hi!
    I need a macro that would delete the IFERROR() from each cell that contains it...
    In other words: if the cell is now e.g. "=IFERROR(x,y)" the macro should make it "=x".

    Do you have any idea how to do it?
    Please help!
    Kris

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,936

    Re: if cell is wrapped with IFERROR function, then delete the function from the cell

    why not just use find and replace instead?
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    11-28-2012
    Location
    Copenhagen
    MS-Off Ver
    Excel 2010
    Posts
    37

    Re: if cell is wrapped with IFERROR function, then delete the function from the cell

    "Find and replace" is not able to do what i need. I need the following:

    IF the cell contains =iferror('here is some other function X with variables' ; 0) THEN
    make the cell contain only ='the function X'.

    Any ideas please?

  4. #4
    Registered User
    Join Date
    11-28-2012
    Location
    Copenhagen
    MS-Off Ver
    Excel 2010
    Posts
    37

    Re: if cell is wrapped with IFERROR function, then delete the function from the cell

    Ok, so this is what I meant (see below code) more or less.
    The problem is that the code works fine if there is only 1 digit (the zero) after the coma: =IFERROR('sth',0)
    If there were more digits (eg. two zeros) then I am in trouble again.
    Any ideas pls?

    Please Login or Register  to view this content.

  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,936

    Re: if cell is wrapped with IFERROR function, then delete the function from the cell

    find and replace will do what you want, it will just take you a few steps to do it tho

  6. #6
    Registered User
    Join Date
    11-28-2012
    Location
    Copenhagen
    MS-Off Ver
    Excel 2010
    Posts
    37

    Re: if cell is wrapped with IFERROR function, then delete the function from the cell

    find and replace? how? i am not that familiar with the functions... could you explain more or propose some vba code?

    what I need is that the macro works the similarly as my macro i posted above, just with the difference that my macro does not automatically adjusts if there are more than one digit after the coma (see my above post).

  7. #7
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,936

    Re: if cell is wrapped with IFERROR function, then delete the function from the cell

    it's a manual process.

    1. find/replace = with '=
    2. find/replace iferror( with ""
    3. find/replace ) with ""
    4. find/replace'= with =

  8. #8
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: if cell is wrapped with IFERROR function, then delete the function from the cell

    This macro should do what you need, providing it only ever encounters IFERROR wrapping other formula and never within a formula.

    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)

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