Find and Replace Multiple values in all worksheets

Average Joe

New Member
Joined
Jul 20, 2012
Messages
15
Hi,
Does anybody have any suggestions / alternatives to modify the below code to allow find and replace multiple values on all worksheets?
Also, if there is a way to fix replacing range, rather than having to select it each time?

Thanks

Code:
Sub MultiFindNReplaceNew()
Dim Rng As Range
Dim InputRng As Range, ReplaceRng As Range
xTitleId = "Test"
Set InputRng = Application.Selection
Set InputRng = Application.InputBox("Original Range ", xTitleId, InputRng.Address, Type:=8)
Set ReplaceRng = Application.InputBox("Replace Range :", xTitleId, Type:=8)
Application.ScreenUpdating = False
For Each Rng In ReplaceRng.Columns(1).Cells
    InputRng.Replace what:=Rng.Value, replacement:=Rng.Offset(0, 1).Value
Next
Application.ScreenUpdating = True
End Sub
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
Glad to help & thanks for the feedback
 
Upvote 0
Hi, good. The solution is amazing and really helps me.

I would like to know if there is a way so I can 'Find' and 'Replace the exact value'

The values I'm replacing with are hyperlinks. So I would like to replace the new values with those hyperlinks and keep them working hyperlinks.

So column A, orginal = text
Column B, Replace = hyperink

If possible, thanks in advance.
 
Upvote 0
As this is a totally different from the OP, please start a thread of your own.
Thanks
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,240
Members
452,621
Latest member
Laura_PinksBTHFT

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