Macro to Find and replace for a list of words

tonywatsonhelp

Well-known Member
Joined
Feb 24, 2014
Messages
3,194
Office Version
  1. 365
  2. 2019
  3. 2016
Platform
  1. Windows
Hi Everyone,
I have a list of Find and replace words in sheet Control.
Column H2:H (Last row) is the find words
Column I2:I (Last row) is the Replace words
I just want a macro to run a find and replace for these words on sheet(Raw Data)

please help if you can

Thanks
Tony
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
Try something like
VBA Code:
Sub ReplaceText()

Dim Rng As Range
Dim c As Range

With Sheets("Control")
    Set Rng = .Range("H2:H" & .Cells(.Rows.Count, 8).End(xlUp).Row)
End With

For Each c In Rng
        Sheets("Raw Data").Cells.Replace _
            What:=c.Value, _
            Replacement:=c.Offset(, 1).Value, _
            LookAt:=xlPart
Next c

End Sub
 
Upvote 0

Forum statistics

Threads
1,214,990
Messages
6,122,625
Members
449,093
Latest member
catterz66

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