Michel Montreal

New Member
Joined
Feb 18, 2016
Messages
1
Hello,
I was successfully using this Multiple Find & Replace code (which is on several websites) for the last 2 years at my job and now it's been a few weeks it doesn't work anymore.
I spent several hours researching a solution and trying a few tweaks but my knowledge in VBA is very little and I just don't get to get this code to work (nothing happens when I run the code, no error message). Can anyone please help me?

Basically, I have a column with company names (original range), where I need to find certain names and replace them there.
Name (original range)FindReplace for
SofaDeskDesktop
TableCarTruck
DeskSofaCouch
CarTableTablecloth

<tbody>
</tbody>

This is the code:
Code:
Sub MultiFindNReplace()
'Update 20140722
Dim Rng As Range
Dim InputRng As Range, ReplaceRng As Range
xTitleId = "KutoolsforExcel"
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

Thanks a lot!!!
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
I tried your code, and it worked!
Are you sure you select the right range for both inputbox?
Here's the result:

ABCD
1Name (original range)FindReplace for
2CouchDeskDesktop
3TableclothCarTruck
4DesktopSofaCouch
5TruckTableTablecloth

<tbody>
</tbody>
Sheet2
 
Upvote 0

Forum statistics

Threads
1,214,971
Messages
6,122,520
Members
449,088
Latest member
RandomExceller01

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