Answer the question
In order to leave comments, you need to log in
How to register a macro for to replace a combination of characters?
You need to write a macro for Word so that ", - " is replaced by "", - ".
Selection.Find.Execute Replace:=wdReplaceAll
With Selection.Find
.Text = ", - "
.Replacement.Text = "^34^44 ^45 "
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = True
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Answer the question
In order to leave comments, you need to log in
With Selection.Find
.Text = ", -"
.Replacement.Text = """, -"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = True
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question