Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #4  
Old 06-03-2018, 07:22 AM
jonjozz jonjozz is offline How to highlight lines containing specific words Windows 10 How to highlight lines containing specific words Office 2016
Novice
 
Join Date: Jun 2018
Posts: 1
jonjozz is on a distinguished road
Default

Sub FindWord_and_ChangeColor()

Dim LastRow, i As Long

Selection.HomeKey Unit:=wdStory
With Selection.Find
.ClearFormatting
.Forward = True
.Wrap = wdFindContinue
.Text = "put your text here"
.Execute
End With
Do While Selection.Find.Found
Selection.Expand Unit:=wdSentence
Selection.Font.ColorIndex = wdGreen
Selection.Collapse Direction:=wdCollapseEnd
Selection.Find.Execute
Loop
End Sub
Reply With Quote
 

Tags
formatting, regex

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to highlight lines containing specific words VBA to highlight words if used too much aolszewski Word VBA 3 11-23-2013 02:07 AM
How to highlight lines containing specific words Highlight all underlined words zdodson Word VBA 1 07-11-2013 04:53 PM
How to highlight lines containing specific words Macro to highlight words bertietheblue Word VBA 9 07-01-2013 12:39 PM
How to highlight lines containing specific words Highlight and then replace multiple words redhin Word VBA 5 03-05-2013 05:42 AM
How to highlight lines containing specific words Find and highlight all words ending in -ly RBLampert Word VBA 13 10-23-2012 04:45 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:28 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft