Consulting

Results 1 to 4 of 4

Thread: Match duplicates and copy updated cells from one worksheet to another

  1. #1
    VBAX Regular
    Joined
    Dec 2014
    Posts
    25
    Location

    Match duplicates and copy updated cells from one worksheet to another

    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!

  2. #2
    VBAX Master
    Joined
    Jul 2006
    Location
    Belgium
    Posts
    1,286
    Location
    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

  3. #3
    VBAX Regular
    Joined
    Dec 2014
    Posts
    25
    Location
    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

    Quote Originally Posted by Charlize View Post
    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
    Attached Images Attached Images

  4. #4
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    Did you mean to lose "Mr Thomas," the client?
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •