Thanks in advance, I am trying to match values from sheet1 in column "D" to column A of sheet2 and if any got matched then copy pasting entire row to sheet3 and then delete the entire row from sheet1.
Below code is working fine for matching and deleting:
Sub remDup()
Dim LR As Long, i As Long
With Sheets("Sheet1")
LR = .Range("D" & Rows.Count).End(xlUp).Row
For i = LR To 1 Step -1
If IsNumeric(Application.Match(.Range("D" & i).Value, Sheets("Sheet2").Columns("A"), 0)) Then .Rows(i).Delete
Next i
End With
End Sub
but it doesn't paste's the deleted row in sheet3.
Tried to do something like but no success.
Sub remDup()
Dim LR As Long, i As Long, n As Long
With Sheets("sheet1")
LR = .Range("D" & Rows.Count).End(xlUp).Row
For i = LR To 1 Step -1
If IsNumeric(Application.Match(.Range("D" & i).Value, Sheets("sheet2").Columns("A"), 0)) Then Sheets("sheet3").Row(n) = Rows(i) & .Rows(i).Delete
n = n + 1
Next i
End With
End Sub
Please help, and I also have to match it with three columns in sheet 2 (A, B and C) but in this code I have done it ones with column A only and thought that will run the same code thrice by changing the column name.
Is there a way to do it at once.
Thanks Again.