Hi Dixie.
I've made some modifications. Try this?
Option Explicit
Option Compare Text
Sub HighLightText()
Dim i As Integer, counter As Integer, ExportWb As Object, ImportWb As Object, lr As Range, Foundit as integer
i = 1
counter = 1
Set ImportWb = Workbooks("DB (Old App).xlsx").Sheets("DB (Old App)").Cells
Set ExportWb = Workbooks("Missing PI Tags 20141021b.xlsx").Sheets("Jacobs").Cells
Set lr = Workbooks("DB (Old App).xlsx").Sheets("DB (Old App)").Cells(Rows.Count, 1).End(xlUp).Offset(1, 0)
Do While i < 501
Do While counter < lr.Row + 1
If ExportWb(i, 1).Value = ImportWb(counter, 1).Value Then
Foundit = 1
ImportWb(counter, 1).Interior.ColorIndex = 6
End If
counter = counter + 1
Loop
if Foundit = 1 Then
ExportWb(i, 1).Interior.ColorIndex = 3
End If
Foundit = 0
counter = 1
i = i + 1
Loop
MsgBox ("The task has been completed"), vbInformation
End Sub
Bookmarks