I have the following code that basically works fine. The purpose is to highlight any cells in the "Lookup" sheet that match any of the strings found in the specified range in the "Fails" sheet.
The problem is that this method won't highlight a second or third etc. occurrence of the string in the Lookup sheet. My logic tells me I should loop through the "Lookup" range and compare to the values in the "Fails" array. I've tried lots of different loops, but can't get it to work.
Any help please!!!
The problem is that this method won't highlight a second or third etc. occurrence of the string in the Lookup sheet. My logic tells me I should loop through the "Lookup" range and compare to the values in the "Fails" array. I've tried lots of different loops, but can't get it to work.
Any help please!!!
Code:
Dim myArray As Variant, word As Variant
Dim LastSrcRow As Long, LastDestRow As Long
LastSrcRow = Worksheets("Fails").Range("A65536").End(xlUp).row
LastDestRow = Worksheets("Lookup").Range("A65536").End(xlUp).row
myArray = Worksheets("Fails").Range("T2:T" & LastSrcRow).Value
For Each word In myArray
Worksheets("Lookup").Range("E2:F" & LastDestRow).Find(word).Interior.ColorIndex = 22
Next word