The below procedure will compare a range in Sheet1 with a range in Sheet2 based on the value in column A and, if the active cell includes a matching value, it highlights the active cell. It works great! At least up until I enter values from approximately row 890 in Sheet2 and on. In these instances, when I enter a value that should highlight, nothing happens. No error, the highlight simply doesn't occur. Right now, Sheet2 has approx. 1200 lines of data. What am I missing here? Thanks much for any insight!
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("V2:Y1500")) Is Nothing Then
Dim cRow, cPID, lRow As Long
Dim cVal As String
cVal = Cells(Target.Row, Target.Column).Value
cRow = Target.Row
Sheet1.Cells(cRow, Target.Column).Interior.Color = xlNone
cPID = ActiveSheet.Range("A" & cRow).Value
lRow = Sheet2.Range("A1500").End(xlUp).Value
For i = 2 To lRow
If Sheet2.Range("A" & i).Value = cPID Then
For j = 12 To 29
If Sheet2.Cells(i, j).Value = cVal And Sheet2.Cells(i, j).Value <> "" Then
Sheet1.Cells(cRow, Target.Column).Interior.Color = 65535
Exit Sub
End If
Next j
End If
Next i
End If
End Sub