I'm trying to write a code which takes an old list of values and compares it with a new master list. If the code finds a value from the old list matches one on the new list, I would like the code to copy several cells of data and paste them onto the new master list. Essentially moving all the old matching data to a new list.
Example
Master List--------Old List--------Old Data (columns 3-20)
11----------------2--------------asd
A------------------4--------------asd
B------------------K--------------sdgsd
12----------------11-------------sff
K------------------Q--------------jtfgkfk
N------------------A--------------sdhtsdh
Result
Master List-------Old Data Transfered to matching row
11----------------sff
A-----------------sdhtsdh
B
12
K-----------------sdgsd
N
This is what I have so far. Note I receive an error on like "vToFind = Sheets..."
Sub Adding_Data()
Dim vToFind As Variant
Dim rFindIn As Range
Dim GetRowFound As Long
Dim last As Integer
Dim x As Variant
x = 1
last = 2000
For x = 1 To last
vToFind = Sheets("sorting").Range(x, 2)
rFindIn = Sheets("sorting").Range(Cells(1, 5), Cells(last, 5))
Dim rFound As Range
Set rFound = rFindIn.Find(vToFind, LookIn:=xlValues)
If rFound Is Nothing Then GetRowFound = 0 Else GetRowFound = rFound.Row
Next x
Sheets("sorting").Range(Cells(GetRowFound, 5), Cells(GetRowFound, 80)).Copy
ActiveSheet.Range(x, 3).Paste
End Sub
Thanks
Bookmarks