0

Hello I have an excel worksheet and want to write a macros that will look at the contents of sheet 1 and find any words in the wordbank (sheet 2) and highlight the matching words on sheet 1. Is this possible? thanks for your help!

For example, if i copy the whole article from this link into one cell in sheet 1. and the words in sheet 2 are : how, Euro, 2015, future--the macros will highlight these words on sheet 1.

Sample code is below, it works where it highlights the cell if the word is found but it doesnt highlight the word..

Sub Find_Word()

Dim FindWord As String, Found As Range

FindWord = "euro"

Set Found = Sheets("Sheet1").Cells.Find(What:=FindWord, _
                                        LookIn:=xlValues, _
                                        LookAt:=xlPart, _
                                        SearchOrder:=xlByRows, _
                                        SearchDirection:=xlNext, _
                                        MatchCase:=False)

If Not Found Is Nothing Then
    Found.Select
Else
    MsgBox "No match found."
End If

End Sub

Tai
  • 65
  • 2
  • 11
  • 1
    Please see [ask] and [mcve]. –  Mar 11 '16 at 18:49
  • Please share what you've tried to some it, this isn't a free code writing service where we provide entire solutions. – Máté Juhász Mar 11 '16 at 18:50
  • also, these would have to be an exact match so if i had the word "euro" in sheet 2, it wont pick up the word "european" in sheet 1 – Tai Mar 11 '16 at 19:02
  • im actually super new to macros and not familiar with the code base, is there an article that you can point me to? id love to build off of it if given the structure for this specific scenario – Tai Mar 11 '16 at 19:03

0 Answers0