View Single Post
 
Old 09-23-2018, 12:33 AM
sknanda sknanda is offline Windows 7 32bit Office 2010 32bit
Novice
 
Join Date: Sep 2018
Posts: 15
sknanda is on a distinguished road
Default

Sir, I thank you for your quick response. This was my first post on this forum. I give below what I can. This is the macro:
---------------------
Code:
Sub HiLightList()
Application.ScreenUpdating = False
Dim StrFnd As String, Rng As Range, i As Long
StrFnd = "dog,cat,pig,horse,man"
For i = 0 To UBound(Split(StrFnd, ","))
  Set Rng = ActiveDocument.Range
  With Rng.Find
    .ClearFormatting
    .Text = Split(StrFnd, ",")(i)
    .Replacement.ClearFormatting
    .Replacement.Highlight = True
    .Replacement.Text = "^&"
    .Forward = True
    .Wrap = wdFindContinue
    .Format = True
    .MatchCase = False
    .MatchWholeWord = True
    .MatchWildcards = False
    .MatchSoundsLike = False
    .MatchAllWordForms = True
    .Execute Replace:=wdReplaceAll
  End With
Next
Set Rng = Nothing
Application.ScreenUpdating = True
End Sub
------------------
It was from "macropod
Administrator" dated 5-18-2011. I hope it helps you. I do not know how to refer to this URL.
I tried it by editing macro by replacing find list. IT WORKS!!
Now I need to input my search list "dog,cat,pig,horse,man" from keyboard. Please help. Regards.

Last edited by macropod; 09-24-2018 at 10:20 PM. Reason: Added code tags & formatting