This macro is actually in Word, but the functions shouldn't be too different. What I want to do is to highlight all words ending in -ing but excluding some words like bing (as in the cherry), thing, and being. I figured out how to get the macro to skip over 3 and 4 letter words, but I am not sure how to tweak this to also skip 5 letter words.
I would prefer to have a word list that the macro excludes.
How do you do that? Here is the macro so far:
I would prefer to have a word list that the macro excludes.
How do you do that? Here is the macro so far:
Code:
Sub HighlightING()
Application.ScreenUpdating = False
Dim HlLt As Long
HlLt = Options.DefaultHighlightColorIndex
Options.DefaultHighlightColorIndex = wdYellow
With ActiveDocument.Range.Find
.ClearFormatting
.Replacement.ClearFormatting
.Text = "<[!^09-^13 ][!^09-^13 ]@ing>"
.Replacement.Highlight = True
.Replacement.Text = "^&"
.Forward = True
.Wrap = wdFindStop
.Format = True
.MatchWildcards = True
.Execute Replace:=wdReplaceAll
End With
Options.DefaultHighlightColorIndex = HlLt
Application.ScreenUpdating = True
End Sub