Hi,
First of all this is a great forum and I can honestly say you've all taught me everything I know about VBA (2 whole days experience!).
Anyway, I've modified this macro I found on this forum, all it does is compares 2 lists of 6 digit serial numbers and and then tells me which numbers are in list 1 that are not in list 2.
However, I want to modify it so that it also gives me the numbers in list 2 that are not in list 1 (put into column F). I then need it to cut the matching serial numbers (in columns A and B) from sheet 1 and paste them into sheet 2.
Can anyone help?
Here's the code for what I have so far.
Sub copy_duplicate()
Range("D4:D1000").Select
Selection.ClearContents
Range("D4").Select
Dim r As Long
Dim cr As Long
r = 4
cr = 4
On Error Resume Next
Do While Sheet1.Cells(r, 1) <> ""
a = Application.WorksheetFunction.VLookup(Sheet1.Cells(r, 1), Range("B:B"), 1, 0)
If a <> "" Then
Else
Sheet1.Cells(cr, 4) = Sheet1.Cells(r, 1)
cr = cr + 1
End If
a = ""
r = r + 1
Loop
End Sub
Bookmarks