PDA

View Full Version : Macro for Change text color and highlight



alrizwan
12-20-2010, 10:20 AM
I need vba code for change font color Black from any other colors and highlight in yellow color in the Doc which has some questions with four answers each, one of them is correct answer. the correct answer is
in some Blue, Green, Red and etc. colors or highlighted in different colors.
I want to change them in Highlight in yellow color and change font in Black for saving time.


thanks.

Please help me in this problum

gmaxey
12-20-2010, 10:55 AM
This is a complete stab in the dark and except for the unlikely event it is on target you are going to have to make more effort in explaining what you are really after:
Sub ScratchMacro()
Dim oRng As Word.Range
Set oRng = ActiveDocument.Range
With oRng.Find
.Highlight = True
While .Execute
oRng.HighlightColorIndex = wdYellow
Wend
End With
Set oRng = ActiveDocument.Range
oRng.Font.Color = wdColorBlack
End Sub