viomman
11-04-2009, 08:25 AM
I am trying to loop through cells to compare to a range on another sheet. If two criterias match i want the row to highlight. Here is my code so far
Sub Find_Matches()
Dim CompareRange As Variant, x As Variant, y As Variant
Set CompareRange = Worksheets("Active Projects").Range("A1:A500")
Range("U" & ActiveCell.Row & "").Select
For Each x In Selection
For Each y In CompareRange
If x = y & Range("F" & ActiveCell.Row & "") = "7681" Then cell.EntireRow.Interior.ColorIndex = 4
Next y
Next x
End Sub
Sub Find_Matches()
Dim CompareRange As Variant, x As Variant, y As Variant
Set CompareRange = Worksheets("Active Projects").Range("A1:A500")
Range("U" & ActiveCell.Row & "").Select
For Each x In Selection
For Each y In CompareRange
If x = y & Range("F" & ActiveCell.Row & "") = "7681" Then cell.EntireRow.Interior.ColorIndex = 4
Next y
Next x
End Sub