![]() |
|
#2
|
|||
|
|||
|
Shelly Lou,
Looks fine. I would do it like this using the Select statement: Code:
Sub ScratchMacro()
'A basic Word Macro coded by Gregory K. Maxey
Dim oRng As Range
Dim oChr As Range
Set oRng = ActiveDocument.Range
With oRng.Find
.Highlight = True
While .Execute
Select Case oRng.HighlightColorIndex
Case Is = 9999999
For Each oChr In oRng.Characters
Select Case oChr.HighlightColorIndex
Case wdBrightGreen, wdPink
oChr.HighlightColorIndex = wdAuto
End Select
Next oChr
Case Is = wdBrightGreen
oRng.HighlightColorIndex = wdAuto
Case Is = wdPink
oRng.HighlightColorIndex = wdAuto
End Select
oRng.Collapse wdCollapseEnd
Wend
End With
lbl_Exit:
Exit Sub
End Sub
|
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
VBA Code to remove specific highlight
|
syl3786 | Word VBA | 4 | 03-27-2023 05:01 PM |
Remove highlight with specific color
|
rekent | Word VBA | 2 | 08-01-2020 10:59 AM |
| MS Project: Network Diag view: Task Cell background colour (Highlight) | stct | Project | 0 | 10-17-2017 07:37 AM |
How do I select all text highlighted in a specific colour?
|
bertietheblue | Word | 2 | 04-15-2016 12:30 PM |
| changing the colour of text box highlight in PowerPoint v.x | miki | PowerPoint | 1 | 11-16-2010 02:06 AM |