Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 05-14-2013, 02:45 AM
bakerkr bakerkr is offline Macro to highlight a list of words Windows 7 64bit Macro to highlight a list of words Office 2010 32bit
Novice
Macro to highlight a list of words
 
Join Date: May 2013
Posts: 2
bakerkr is on a distinguished road
Default Macro to highlight a list of words

I came across a macro that will highlight a certain word, in the below example I used the word to.

I'd like to use a list of words, which will allow me to add or delete words as necessary. Is this possible? VBA is okay instead of a macro.



Thanks
Kevin
Code:
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
Selection.Find.Replacement.Highlight = True
With Selection.Find
  .Text = "to"
  .Replacement.Text = "to"
  .Forward = True
  .Wrap = wdFindContinue
  .Format = True
  .MatchCase = False
  .MatchWholeWord = False
  .MatchWildcards = False
  .MatchSoundsLike = False
  .MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
Options.DefaultHighlightColorIndex = wdYellow
Selection.Range.HighlightColorIndex = wdYellow

Last edited by macropod; 05-14-2013 at 08:25 PM. Reason: Added code tags & formatting
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to highlight a list of words Find and highlight multiple words in MS Word document AtaLoss Word VBA 37 09-22-2021 12:04 PM
Macro to highlight a list of words How to make it highlight blocks of text (words) without highlighting extra space @end seortm Word 3 03-30-2015 08:12 AM
Macro to highlight a list of words Highlight and then replace multiple words redhin Word VBA 5 03-05-2013 05:42 AM
Macro to highlight a list of words Find and highlight all words ending in -ly RBLampert Word VBA 13 10-23-2012 04:45 PM
find - reading highlight - highlight all / highlight doesn't stick when saved bobk544 Word 3 04-15-2009 03:31 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 12:05 PM.


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