I’m working on a project with lots of data in two different sheets which is want to combine.
My Sheet1 should contain 4 columns. Columns 1 and 2 are already filled with ID’s and a status.
In Sheet2 I have 3 columns. The first contains the ID’s again, the second a serial-number and the third a Yes/No.
The two sheets have around 5500 rows in it. The first a little more then the second.
I would like to run a loop which picks the first ID in Sheet1, checks if it exists in Sheet2, and if it does, it should copy the two missing columns (serial number and Yes/No) into into Sheet1.
Then the to the next id in Sheet1 and do the same again.
I tried it with the code below, but I’m not getting it to work.
Hope you can help me out!
Dim i As Long Dim Found As Range For i = 1 To Rows.Count Worksheets("Sheet1").Activate If Cells(i, 1).Value <> "" Then Set Found = Worksheets("Sheet2").Range("A2", Range("A")).Find(i, 1) If Not Found Is Nothing Then Worksheets("Sheet1").Range(i, 3).Value = Cells(Found.Row, 2).Value Worksheets("Sheet1").Range(i, 4).Value = Cells(Found.Row, 3).Value End If End If Next i