![]() |
|
|
|
#1
|
||||
|
||||
|
If you want to mark Pricing in Pricing Graph then you can search for Pricing Graph and mark the first word of the found text e.g. Code:
Sub Macro1()
'Graham Mayor 14 May 2015
Dim oRng As Range
Set oRng = ActiveDocument.Range 'or Selection.Range
With oRng.Find
Do While .Execute(FindText:="Pricing Graph")
oRng.Words(1).HighlightColorIndex = wdYellow
Exit Do 'Remove if you want all 'Pricing Graph' entries to be found
Loop
End With
lbl_Exit:
Exit Sub
End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
|
| Tags |
| formatting text, selective replacement |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Problem replacing text.
|
piritzo | Word | 2 | 06-22-2013 12:50 AM |
Creating a plain text content control for every instance of a word or phrase
|
RobsterCraw | Word VBA | 16 | 11-20-2012 03:25 PM |
Help with replacing text with wildcards
|
sbatson5 | Word | 2 | 04-13-2012 03:49 AM |
| Highlight text and find next instance | DrDOS | Word | 0 | 11-15-2010 04:02 PM |
| Replacing / editting text | LisaC | Word | 0 | 02-25-2010 03:40 AM |