Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- https://excel-egy.com/forum/t4702
- ---------------------------------
- Sub Compare_Two_Columns_Using_Find_Method()
- Dim c As Range, m As Long, r As Long, t As Long
- Application.ScreenUpdating = False
- Columns(2).Interior.Color = xlNone
- Columns(3).ClearContents
- m = Range("B" & Rows.Count).End(xlUp).Row
- For r = 2 To m
- Set c = Range("A:A").Find(What:=Range("B" & r).Value, LookAt:=xlWhole)
- If Not c Is Nothing And c <> Empty Then
- t = c.Row
- Range("C" & t).Value = Range("A" & t).Value
- Range("B" & r).Interior.Color = vbCyan
- End If
- Next r
- Application.ScreenUpdating = True
- MsgBox "Done...", 64
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement