Results 1 to 8 of 8

Remove If Statement From Cell Leaving [Value_If_False] From Formula

Threaded View

  1. #1
    Registered User
    Join Date
    02-14-2012
    Location
    Ohio
    MS-Off Ver
    Excel 2007/10
    Posts
    5

    Remove If Statement From Cell Leaving [Value_If_False] From Formula

    I need to figure out a VBA that will search the sheets for all formulas containing If statements and delete everything except for the final clause of the formula

    [Per_Hour_Wage is a named range]
    =IF(ISNUMBER(Per_Hour_Wage)=FALSE,"#Wage!",IF(ISNUMBER(C16)=FALSE,C16,(C16*Per_Hour_Wage)))
    Would produce
    =(C16*Per_Hour_Wage)

    I can't have it just select the right x characters in the formulas since the length of the relevent formula will change with each cell. Possibly search for length to the right of the last comma then return that part of the formula?

    Elsewhere in this VBA I will have it copy the relevent sheets to a new file then it will need to perform this proceedure before I can send this out to auditors.




    [Background] Need to create a workbook for auditors that will simplify the formulas I am using in my sheets. This will be similar to a values only copy Except it will still have working formulas, just immensely simplified. The workbook has formulas throughout it that include nested if statements that will throw up a custom error message (#Wage!, #Weeks!) that will quickly show me which data I am missing from the calculation, this prevents sending out partial data. But those who will be auditing the data have become confused with those being included in what I send them.
    Attached Files Attached Files

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