Hello,
I have a macro code to copy new item from New Item List worksheet to Item Detail worksheet. However, I need any addtional input in the code so when it copy new items to the worksheet it will look up column C in that worksheet and if there is already a item in that spreadsheet it won't copy the item from the New Item List to the item detail worksheet but still copy other new items instead. Below is the code. Thanks.
Sub Test2()
Dim wrk As Worksheet
Set wrk = Sheets("Item Detail")
Sheets("New Item List").Activate
For y = 2 To ActiveSheet.Range("a" & Rows.Count).End(xlUp).Row
x = wrk.Range("c" & wrk.Rows.Count).End(xlUp).Row
wrk.Range("c" & x + 1) = ActiveSheet.Range("a" & y)
Z = wrk.Range("e" & wrk.Rows.Count).End(xlUp).Row
wrk.Range("e" & x + 1) = ActiveSheet.Range("c" & y)
lastrow = wrk.Range("B" & Rows.Count).End(xlUp).Row
wrk.Range("B" & lastrow).FillDown
Next
Sheets("Item Detail").Select
MsgBox "Process Completd", vbInformation, "Xlbiznes"
End Sub
Bookmarks