PDA

View Full Version : Match duplicates and copy updated cells from one worksheet to another



markpem
12-15-2014, 09:52 AM
Hello
I currently have two sheets (sheet1 and sheet2) with duplicate data in, however in sheet 1 some columns are
filled and blank and in sheet 2 some columns are filled and blank. I need some vba code to enable me to click a
button to:-
Match the case number on sheet 1 and sheet 2 and then on sheet 2 any data that is in a cell that either does not
exist in sheet1 or is different to sheet 1 to update sheet1. Once updated to delete the matched data in sheet 2.
in sheet1 I have data in columns like this

(a) Case Number - (b) Client (c) User - (d) Date ...... (i) outcome
in sheet 2 I have a data like this:
(a) Case number (b) [blank] (c) User (d) Date... (Everything else is blank here)

so for example:-

Sheet 1
(a) (b) (c) (d) (I)
12345 Mr Smith Timothy Jones 15/12/2014 Completed

sheet 2
(a) (b) (c) (d)
12345 Jake Peterson
In sheet 2, the update is now that Jake Peterson has taken over but I do not want to copy the data in B as it's
blank and it will overwrite
Rather than doing a paste row it would have to be a paste cell as I do not want any data like (i) overwritten either.

Please note that sheet two will always have the case number in (a) to enable a match.

Could anyone help me please!

Charlize
12-15-2014, 10:47 AM
So you want everything from sheet 2 to sheet 1 only if sheet 2 isn't blank ?
And if something exists in a certain cell , add that from sheet 2

The cell in sheet 1 can have multiple lines than ?

Charlize

markpem
12-16-2014, 01:36 AM
Hello Charlize

First off, thankyou for the reponse.

I have attached a picture which will make it a lot more easier for me to describe. Sheet 2 will always have data in, and I need to match reference numbers on both sheets and copy the data from sheet 2 and overwrite sheet 1.

Thanks

MP


So you want everything from sheet 2 to sheet 1 only if sheet 2 isn't blank ?
And if something exists in a certain cell , add that from sheet 2

The cell in sheet 1 can have multiple lines than ?

Charlize

SamT
12-16-2014, 11:12 AM
Did you mean to lose "Mr Thomas," the client?