Here's what I got:
Sub Find()
Dim CompareRange As Variant, CompareRange2 As Variant, x As Variant, y As Variant
Set CompareRange = Range("C1:C5")
Set CompareRange2 = Range("E1:E5")
For Each x In CompareRange2
For Each y In CompareRange
If x = y Then
x.Offset(0, 2) = x
Else
x.Offset(0, 4) = x
End If
Next y
Next x
End Sub
What it does is compare every cell in the first range to every cell in the second range. What I need it to do is compare the first cell to the first cell, the second cell to the second, etc. How do I get vba to isolate in rows like that?
Sub Find()
Dim CompareRange As Variant, CompareRange2 As Variant, x As Variant, y As Variant
Set CompareRange = Range("C1:C5")
Set CompareRange2 = Range("E1:E5")
For Each x In CompareRange2
For Each y In CompareRange
If x = y Then
x.Offset(0, 2) = x
Else
x.Offset(0, 4) = x
End If
Next y
Next x
End Sub
What it does is compare every cell in the first range to every cell in the second range. What I need it to do is compare the first cell to the first cell, the second cell to the second, etc. How do I get vba to isolate in rows like that?