Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sub highlightdup()
- Dim I, J As Long
- Dim xRngFind, xRng As Range
- Dim xStrFind, xStr As String
- Options.DefaultHighlightColorIndex = wdYellow
- Application.ScreenUpdating = False
- With ActiveDocument
- For I = 1 To .Paragraphs.Count - 1
- Set xRngFind = .Paragraphs(I).Range
- If xRngFind.HighlightColorIndex <> wdYellow Then
- For J = I + 1 To .Paragraphs.Count
- Set xRng = .Paragraphs(J).Range
- If xRngFind.Text = xRng.Text Then
- xRngFind.HighlightColorIndex = wdBrightGreen
- xRng.HighlightColorIndex = wdYellow
- End If
- Next
- End If
- Next
- End With
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement