Your question, your audience. Choose who sees your identity—and your question—with question security.
Sub Percent()
Dim rng1 As Range
Set rng1 = ActiveDocument.Range
Application.Options.DefaultHighlightColorIndex = wdYellow
With rng1.Find
.MatchWildcards = True
.Text = "\(*\)"
.Replacement.Highlight = True
.Execute Replace:=wdReplaceAll
.Text = "\[*\]"
.Replacement.Highlight = True
.Execute Replace:=wdReplaceAll
.MatchWildcards = False
.Text = "percent"
.Highlight = True
.Replacement.Text = "%"
.Execute Replace:=wdReplaceAll
.Text = "%"
.Highlight = False
.Replacement.Text = "percent"
.Execute Replace:=wdReplaceAll
End With
ActiveDocument.Range.HighlightColorIndex = wdNoHighlight
End Sub
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
"for any text that is not enclosed by ( ) or [ ] ". 'Any text' is a bit vague. It could be a whole document, a paragraph, a word, one character or anything in between.
For that which is already enclosed, what needs to be changed to a % symbol?
Perhaps a few examples would help.