![]() |
|
|
|
#1
|
|||
|
|||
|
Code:
Sub ScratchMacro()
'A basic Word Macro coded by Gregory K. Maxey
Dim oRng As Range
Set oRng = ActiveDocument.Range
With oRng.Find
.Highlight = True
While .Execute
Select Case oRng.HighlightColorIndex
Case Is = 9999999
oRng.HighlightColorIndex = wdAuto
End Select
oRng.Collapse wdCollapseEnd
Wend
End With
lbl_Exit:
Exit Sub
End Sub
|
|
#2
|
|||
|
|||
|
Quote:
|
|
| Tags |
| highlight, macro, word vba |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
VBA Highlight numbers only after or before specific words help
|
Shelley Lou | Word VBA | 12 | 08-09-2022 03:02 AM |
Remove highlight with specific color
|
rekent | Word VBA | 2 | 08-01-2020 10:59 AM |
| How to highlight lines containing specific words | SixStringSW | Word VBA | 4 | 06-03-2018 03:57 PM |
| VBA to highlight specific values in the spreadsheet | daiwuliz | Excel | 6 | 05-23-2018 10:30 AM |
| Highlight the current cell without using code | parshla | Excel | 0 | 09-08-2016 08:10 PM |