Code: Select all
j = wb2.Sheets(Format(strDateWork, "dd")).Range("B6").End(xlDown).Row - 1
Set SrcRng = wb2.Sheets(Format(strDateWork, "dd")).Range("B6:B" & j)
i = wb2.Sheets("Report").Range("A1").End(xlDown).Row
Set DstRng = wb2.Sheets("Report").Range("A1:A" & i)
'Establish if each cell in SrcRng exists in DstRng, if not exists,
wb2.Sheets("Report").Rows(i).Copy
Rows(i + 1).Insert Shift:=xlDown 'And rename ("A" & i + 1) with value of SrcRng
I am trying to compare 2 range's on 2 different sheets and update the report sheet (DstRng) with any new items detailed in the SrcRng. I am somewhat there, but have hit a wall.
For each cell in SrcRng that does not already exist in DstRng, I need to copy the last row of DstRng down one (contains loads of formula in columns B onwards), and update the value in DstRng column A with the value from SrcRng.