i am trying to compare two worksheet sheet1 & sheet2 within same workbook and move Matching values in Matched worksheet & unmatching
values in unmatched sheet, dont understand why below code is not working properly, i will appreciate any help on this
values in unmatched sheet, dont understand why below code is not working properly, i will appreciate any help on this
Code:
Sub test()
Dim i As Long
For i = 2 To 10 Step -1
If Sheets("sheet1").Cells(i, 1).Value <> Sheets("sheet2").Cells(i, 1).Value Then
Cells(i, 1).EntireRow.Copy
Sheets("Unmatched").Select
Sheets("Unmatched").Range("A" & Rows.Count).End(xlUp).Offset(1).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Else
Cells(i, 1).EntireRow.Copy
Sheets("Matched").Select
Sheets("Matched").Range("A" & Rows.Count).End(xlUp).Offset(1).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
End If
Next i
End Sub