+ Reply to Thread
Results 1 to 7 of 7

Compare two worksheets and copy the missing values to sheet 3 (duplicate must be needed)

  1. #1
    Registered User
    Join Date
    05-27-2013
    Location
    india
    MS-Off Ver
    Excel 2003
    Posts
    4

    Post Compare two worksheets and copy the missing values to sheet 3 (duplicate must be needed)

    I need a macro to compare to worksheets (eg., Sheet1 and sheet2), such that the missing values should be copied into the new sheet (sheet3).

    Note: the two input sheets( sheet1 and sheet2) has data in the below formate.

    The compare should be Sheet2 with sheet1 (becoz sheet1 data is the master data)

    Sheet1:

    Column Column
    A ..... . B
    ------- --------
    AAAAA ..... . 3------------> This value 3 represents the value of coulmn A ("AAAAA") has 3 occurcance
    BBBBBB ..... . 4 ------------> This value 4 represents the value of coulmn A ("BBBBBB") has 3 occurcance
    CCCCC ..... . 2 -----------> similarly
    EEEEEE ..... . 1 -----------> " "
    WWWW ..... . 3 ----------> " "


    (i.e) the above sheet1 represents has mentioned below
    Column
    A
    AAAAA
    AAAAA
    AAAAA
    BBBBBB
    BBBBBB
    BBBBBB
    BBBBBB
    CCCCC
    ""

    Sheet2:

    Column
    A
    --------
    AAAAA
    AAAAA
    BBBBBB
    CCCCC
    EEEEEE
    WWWW


    So after comparing both sheet1 and sheet2 with above data, the results should be has mentioned below:


    Sheet3 should be:
    The compare should be Sheet2 with sheet1 (becoz sheet1 data is the master data)

    Column
    A
    --------
    AAAAA
    BBBBBB
    BBBBBB
    BBBBBB
    CCCCC
    WWWW
    WWWW

    incase if some of the value in sheet2 is not present in sheet1 then these data should be copied in sheet4.

    Please Some one wirte the macro code to result the above functionalities.

    Thanks in Advance

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,592

    Re: Compare two worksheets and copy the missing values to sheet 3 (duplicate must be neede

    Can you upload example workbook with your input and desired output?

  3. #3
    Registered User
    Join Date
    05-27-2013
    Location
    india
    MS-Off Ver
    Excel 2003
    Posts
    4

    Post Re: Compare two worksheets and copy the missing values to sheet 3 (duplicate must be neede

    Hi

    Please find the attached excel sheet..
    Attached Files Attached Files
    Last edited by NAVEEN_1507; 06-07-2013 at 05:33 AM.

  4. #4
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Compare two worksheets and copy the missing values to sheet 3 (duplicate must be neede

    Your result in sheet3 is very confusing.
    53DFS1I
    appears on both sheets, so how come it appears on sheet3 as a missing item?
    All sheet 2 lines, except BAMAP2I appear in sheet2. Are you comparing both sheets? Missing items can come only from sheet1(All items of sheet2, except BAMAp2i appear in sheet).
    sheet 4 is correct in a sense these two items are missing from sheet1

  5. #5
    Registered User
    Join Date
    05-27-2013
    Location
    india
    MS-Off Ver
    Excel 2003
    Posts
    4

    Post Re: Compare two worksheets and copy the missing values to sheet 3 (duplicate must be neede

    Actually the sheet1 has two columns (A & B), the column A contains the values and column B contains no of Occurrences of "column A" has mentioned in the attached excel sheet:

    i want to compare the sheet2 data with sheet1(sheet1 is the master sheet). When compared all the missing values in sheet2 should be copied to sheet3.

    Please find the sample sheet attached
    Attached Files Attached Files
    Last edited by NAVEEN_1507; 06-07-2013 at 05:34 AM.

  6. #6
    Registered User
    Join Date
    05-27-2013
    Location
    india
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Compare two worksheets and copy the missing values to sheet 3 (duplicate must be neede

    Thanks for everyone... I found the solution..

  7. #7
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Compare two worksheets and copy the missing values to sheet 3 (duplicate must be neede

    If you solve a problem yourself before anyone else has responded, please take a moment to describe your solution, chances are some other member will benefit.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1