似たようなソースコードを作ってみました
なぜだかエラーがでます

Sub test()

Dim i As Long
Dim j As Long
Dim U As Long

For i = 1 To Cells(Rows.Count, 1).End(xUp).Row
For j = 1 To Cells(Rows.Count, 3).End(xUp).Row

If Cells(i, 1) = Cells(j, 3) Then
U = 1
End If

Next j

If U = 1 Then
U = 0
Else
Cells(j, 3).ColorIndex = 3
End If

Next i

End Sub