This macro finds the last row of data on two worksheets, copies data from one range to another on a different worksheet, removes any duplicate values, and selects the target range. It activates different worksheets, finds the last row, copies and pastes values from one range to another, and removes duplicate values in the target range.
2. Worksheets("Sheet2").Activate
Worksheets("Sheet2").Range("a1").Select
'Create a name for the target destination
SetDest = Worksheets("Sheet2").Range("A"&lastrow1+ 1)
'paste the data into the newlyselectedfield
Dest.Select
Dest.PasteSpecialxlPasteValues
'CheckSheet2for duplicate values
ActiveSheet.Range("A:F").RemoveDuplicatesColumns:=Array(1,2,3, 4, 5, 6), _
Header:=xlYes
Range("A"&lastrow1+ 1).Select
End If
End Sub