Replace several words to One
dim myWords as Variant
dim wCtr as long
myWords = array("FXG","FXR","GFX","FXT")
for wctr = lbound(mywords) to ubound(mywords)
activesheet.range("c1:C3169").replace what:=mywords(wctr), _
replacement:="FAX", lookat:=xlPart, SearchOrder:=xlByRows, _
MatchCase:=False, SearchFormat:=False, ReplaceFormat:=False
next wctr
Wanna Learn wrote:
Hello How do I correct the macro below. I want to change the words FXG,
FXR, GFX, and FXT to say FAX
Thank you thank you
Range("C1:C3169").Select
Selection.Replace What:=("FXG""FXR""GFX""FXT")Replacement:="FAX",
LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
End Sub
--
Dave Peterson
|