View Single Post
 
Old 11-15-2015, 02:17 PM
kristib kristib is offline Windows 8 Office 2013
Novice
 
Join Date: Nov 2015
Posts: 3
kristib is on a distinguished road
Default

Thank you so much for replying. I used your exact code, except I replaced the Find text with my actual text. I am getting a Run-time error 5560: The Find What text contains a pattern match expression which is not valid.

My code below:

Sub Demo()
Application.ScreenUpdating = False
With ActiveDocument.Range
With .Find
.ClearFormatting
.Replacement.ClearFormatting
.Text = "{Sat Breakfast}"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchWildcards = True
.Execute
End With
Do While .Find.Found
If .Information(wdWithInTable) = True Then
.Rows(1).Shading.BackgroundPatternColorIndex = wdYellow
'.Delete
End If
.Collapse wdCollapseEnd
.Find.Execute
Loop
End With
Application.ScreenUpdating = True
End Sub

Any other ideas?
Reply With Quote