kylefoley76
Well-known Member
- Joined
- Mar 1, 2010
- Messages
- 1,553
ok, i've got to do about 500 different find and replace operations so getting this macro written could save me maybe 4 hours of work. i'm just trying to figure out how you change the macro so that you do more than one find and replace operation. i tried to change it myself but it didn't really work.
this is also for word by the way, but i figure that there cannot be much difference between word and excel visual basic. this macro works for one find and replace but not three.
this is also for word by the way, but i figure that there cannot be much difference between word and excel visual basic. this macro works for one find and replace but not three.
Code:
Sub Macro1()
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = " mit der "
.Replacement.Text = " mitder"
.Text = " mit dem "
.Replacement.Text = " mitdem"
.Text = " mit den "
.Replacement.Text = " mitden"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub