I have two worksheets and want to paste two cells from the second worksheet (Sheet1) when find the first match in active sheet. Then delete the source row in Sheet1. I can't loop from the last row of the active sheet because I want to populate the first row from the top that matches. I'm also struggling to activate Sheet1 in order to delete the row:
Sub moveRecords()
Dim i, j As Long
With ActiveSheet
'need to work down in active sheet in order to populate the first match with cells 1 & 2
For i = 2 To 100
For j = 2 To 1000
If Cells(n, 1).Value = Sheets("Sheet1").Cells(j, 1).Value _
And Cells(n, 2).Value = Sheets("Sheet1").Cells(j, 2).Value Then
Cells(n, 7).Value = Sheets("Sheet1").Cells(j, 1).Value
Cells(n, 8).Value = Sheets("Sheet1").Cells(j, 2).Value
'need to delete the source row in Sheet1
End If
Next j
Next n
End With
End Sub