A family of Microsoft word processing software products for creating web, email, and print documents.
Hi Steve,
Is your requirement for the code you provided to only affect content with a font size of 14.5?
If so, please review the code below to see if it meets your needs:
Sub Track_Names2()
Dim rng As Range
Dim i As Long
Dim TargetList As Variant
TargetList = Array("AWAPUNI SYNTHETIC", "HAWERA", "ASCOT PARK", "HASTINGS", "PUKEKOHE", _
"NEW PLYMOUTH", "RICCARTON", "PHAR LAP", "WAVERLEY", "ROTORUA", _
"TAURANGA", "TRENTHAM", "WHANGANUI", "RICCARTON SYNTHETIC", "TE RAPA", _
"OAMARU", "TAUPO", "WOODVILLE", "RIVERTON", "WINGATUI", "MATAMATA", _
"ASHBURTON", "CROMWELL", "OTAKI-MAORI", "TE AROHA", "WINGATUI", _
"CAMBRIDGE SYNTHETIC", "ELLERSLIE", "WHANGANUI", "REEFTON", "KUMARA", _
"RUAKAKA", "TAUHERENIKAU", "GREYMOUTH")
For i = 0 To UBound(TargetList)
Set rng = ActiveDocument.Range
With rng.Find
.Text = TargetList(i)
.Format = True
.MatchCase = True
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
Do While .Execute(Forward:=True) = True
If rng.Font.Size = 14.5 Then
rng.Font.Bold = True
rng.Font.Color = wdColorRed
rng.HighlightColorIndex = wdTurquoise
End If
Loop
End With
Next i
End Sub
Looking forward to your reply.
Best Regards,
Jonathan Z - MSFT | Microsoft Community Support Specialist