L
Legacy 322463
Guest
I have a workbook with a worksheet named "Master" which holds a list of projects extracted from another system in CSV format.
I so far have a macro that imports the CSV to a new worksheet "Temp".
I then need to check for new records based on the unique reference in Column A of "Temp" and "Master". If there is a new unique row in "Temp" then it needs to be copied and appended to the end of the current list.
From searching around I have found and amended below, but this only copies the contents from Column A and doesn't append to the list in Master but replaces the rows. (I don't want the existing rows to be impacted):
Sub CopyUnique()
Dim Sh1 As Worksheet
Dim Rng As Range
Dim Sh2 As Worksheet
Set Sh1 = Worksheets("Temp")
Set Rng = Sh1.Range("A1:A" & Sh1.Range("A65536").End(xlUp).Row)
Set Sh2 = Worksheets("Master")
Rng.Cells(1, 1).Copy Sh2.Cells(1, 1)
Rng.AdvancedFilter Action:=xlFilterCopy, CopyToRange:=Sh2.Range("A1"), Unique:=True
End Sub
Any help would be greatly apprectiated!
I so far have a macro that imports the CSV to a new worksheet "Temp".
I then need to check for new records based on the unique reference in Column A of "Temp" and "Master". If there is a new unique row in "Temp" then it needs to be copied and appended to the end of the current list.
From searching around I have found and amended below, but this only copies the contents from Column A and doesn't append to the list in Master but replaces the rows. (I don't want the existing rows to be impacted):
Sub CopyUnique()
Dim Sh1 As Worksheet
Dim Rng As Range
Dim Sh2 As Worksheet
Set Sh1 = Worksheets("Temp")
Set Rng = Sh1.Range("A1:A" & Sh1.Range("A65536").End(xlUp).Row)
Set Sh2 = Worksheets("Master")
Rng.Cells(1, 1).Copy Sh2.Cells(1, 1)
Rng.AdvancedFilter Action:=xlFilterCopy, CopyToRange:=Sh2.Range("A1"), Unique:=True
End Sub
Any help would be greatly apprectiated!