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.
Bookmarks