+ Reply to Thread
Results 1 to 13 of 13

Compare data between sheets

  1. #1
    Forum Contributor
    Join Date
    08-27-2009
    Location
    South Africa
    MS-Off Ver
    Office 2010
    Posts
    217

    Question Compare data between sheets

    I have areal brain twister here, I tried everything but just can not get this to work. I am trying to compare 2 worksheets so it shows me the diff on a 3rd sheet. I have attached an example of what I mean.

    Thanks
    Attached Files Attached Files
    Last edited by Sniper; 05-11-2010 at 03:44 AM.

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,960

    Re: Compare data between sheets

    Don't understand why you laid out the compare sheet the way you did. I redid it and sorted the data sheets, the compare sheet uses VLOOKUP:
    Last edited by protonLeah; 05-09-2010 at 04:51 PM.
    Ben Van Johnson

  3. #3
    Forum Contributor
    Join Date
    08-27-2009
    Location
    South Africa
    MS-Off Ver
    Office 2010
    Posts
    217

    Re: Compare data between sheets

    Thanks a lot works great

  4. #4
    Forum Contributor
    Join Date
    08-27-2009
    Location
    South Africa
    MS-Off Ver
    Office 2010
    Posts
    217

    Re: Compare data between sheets

    I had a previous post about this but at first I thought the help given would work but after 8 hours I now see it's not the way to go. I have 2 sheets that I need to compare withe each other, the biggest problem is that there are a lot of duplicates that shouldn't be removed so the vlookup function doesn't work. I did attach a new example.
    Attached Files Attached Files

  5. #5
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Compare data between sheets

    Hi sniper

    What are the markers you're comparing on, only column A of Data1 and column A of Data2? I could probably figure it out if I studied your data but then I'd only be guessing.

    John
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Compare data between sheets

    Another problem with your data is that the names have leading spaces, trailing spaces, and inconsistent spaces, e.g., "MANYAKA MP " and "MANYAKA M P".
    Last edited by shg; 05-08-2010 at 03:42 PM.
    Entia non sunt multiplicanda sine necessitate

  7. #7
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Compare data between sheets

    Hi sniper

    Assuming your key is only column A, the code in the attached workbook appears to do as you require. Let me know of issues.

    John
    Attached Files Attached Files

  8. #8
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Compare data between sheets

    Just for other members, the code requires Excel 2007+.

  9. #9
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Compare data between sheets

    Ha!!! Burned again. I usually do testing in Excel 2000; don't know why I didn't this time. Oh well. Here's the code for Excel 2000 and later.

    Please Login or Register  to view this content.
    John

  10. #10
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Compare data between sheets

    Thanks shg

    John

  11. #11
    Forum Contributor
    Join Date
    08-27-2009
    Location
    South Africa
    MS-Off Ver
    Office 2010
    Posts
    217

    Re: Compare data between sheets

    You guys are great it's PERFECT!!!!!!! Thanks a lot

  12. #12
    Forum Contributor
    Join Date
    08-27-2009
    Location
    South Africa
    MS-Off Ver
    Office 2010
    Posts
    217

    Re: Compare data between sheets

    Hi Guys

    Once again I need your help, This code works great only problem I have is that when there are a lot of the same client no it does sort the amounts at the same place. I did play around with the code but can't find a way for it to sort it accordingly. Any ideas on how to fix this??

    I did add a workbook to show what I mean.

    Thanks
    Last edited by Sniper; 05-11-2010 at 03:43 AM.

  13. #13
    Forum Contributor
    Join Date
    08-27-2009
    Location
    South Africa
    MS-Off Ver
    Office 2010
    Posts
    217

    Re: Compare data between sheets

    Never mind it's sorted out - I just sorted the pages

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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