Find and Replace?

rhaney

Board Regular
Joined
Sep 27, 2009
Messages
64
Good afternoon!
If you have a worksheet with several iterations of a formula in a column, is there a way to use find and replace to put something at the beginning and end of each of the formulas. For example - putting an iferror statement into an existing group of formulas.

Thank you!
Robert
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
I ran into this issue yesterday and adding an iferror gets to be a little more complicated. What i ended up doing was(using ctrl+h):

replace the first portion of the formula's =if( with '=iferror(if

This way, you don't get hung on the error about not completing the iferror part of the function.

next replace the end of your function using enough of it to make sure it is unique and will only replace what you need
<a5),a3,a1+5), then="" you="" would="" replace="" something="" like="" +5)="" with="" +5),"")<a2),a1+5)="" use="" ctrl+h="" to="" 5)="" 5),"")="" or="" of="" that="" nature.
<a2,a2,a1+2), then="" you="" would="" replace="" +2)="" with="" +2),"")
Now the tricky part...removing the apostrophe which is a hidden character. I found this macro yesterday when I figured out this workaround.

Code:
Private Sub ApostroRemove()
    For Each currentcell In Selection
        If currentcell.HasFormula = False Then
            'Verifies that procedure does not change the
            'cell with the active formula so that it contains
            'only the value.
            currentcell.Formula = currentcell.Value
        End If
    Next
End Sub
And that should do it.</a2,a2,a1+2),></a5),a3,a1+5),>
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,590
Messages
6,179,762
Members
452,940
Latest member
rootytrip

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top