Cinema
11-27-2015, 05:05 AM
Hello,
I want to highlight all numbers in a word document (for which I have written a macro) but I don't want to highlight the number(s) if there is a M or MC before the number(s).
This is my current code:
Sub Highlight()
Selection.Find.ClearFormatting
Selection.Find.Highlight = False
Selection.Find.Replacement.ClearFormatting
Selection.Find.Replacement.Highlight = True
With Selection.Find
.Text = "([0-9])"
.Replacement.Text = "\1"
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute
Selection.Find.Execute Replace:=wdReplaceAll
End Sub
How I can ignore the M[0-9] and MC[0-9]?
I want to highlight all numbers in a word document (for which I have written a macro) but I don't want to highlight the number(s) if there is a M or MC before the number(s).
This is my current code:
Sub Highlight()
Selection.Find.ClearFormatting
Selection.Find.Highlight = False
Selection.Find.Replacement.ClearFormatting
Selection.Find.Replacement.Highlight = True
With Selection.Find
.Text = "([0-9])"
.Replacement.Text = "\1"
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute
Selection.Find.Execute Replace:=wdReplaceAll
End Sub
How I can ignore the M[0-9] and MC[0-9]?