Mass Find And Replace

boxboy30

Board Regular
Joined
Sep 16, 2011
Messages
84
How do I find and replace many things at once....example:

ShawnH
ShawnHa
shawnHarr
Shawn.
ShawnT

I want to find all of these and replace with Shawn...

Cells.Replace What:="ShawnH" & "ShawnHa" & "ShawnHarr" & "Shawn." & "ShawnT", Replacement:="Shawn", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

this isnt' working though! What am I missing?
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
"ShawnH" & "ShawnHa" & "ShawnHarr" & "Shawn." & "ShawnT" results in the string "ShawnHShawnHaShawnHarrShawn.ShawnT".

You need to do Cells.Replace several times for each searched word.
 
Upvote 0
Maybe

Code:
Cells.Replace What:="Shawn*", Replacement:="Shawn", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
 
Upvote 0
Pretty much it will work with the *. You will have some difficulty if you wanted to exclude Shawn.Buddhist for example.
 
Upvote 0
No. What I meant is that using Shawn* will replace anything beginning with Shawn with Shawn. You might not always want that.
 
Upvote 0

Forum statistics

Threads
1,224,600
Messages
6,179,836
Members
452,947
Latest member
Gerry_F

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