MrExcel Publishing
Your One Stop for Excel Tips & Solutions

Automate Find & Replace


Posted by Shanna on January 04, 2002 9:25 AM

Can I automate the process of finding "value1" and "value2" in column D and replacing them with "value3?"

Thanks :-)


Posted by DonnaW on January 04, 2002 10:00 AM

Depends on how you want to automate ...

If you just want to click a button to do so ...

create a macro. For example:

Sub Macro2Replace()
Columns("D:D").Select
Range("D1").Activate
Selection.Replace What:="xxx", Replacement:="xxy", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False
End Sub

Where xxx = what you want to search for
xxy = what you want to replace with.

If you want, you can put the macro on a menu or toolbar or, create a keyboard shortcut for it.

DW