+ Reply to Thread
Results 1 to 10 of 10

Compare Two Sheets and Highlight Differences

  1. #1
    Valued Forum Contributor Blake 7's Avatar
    Join Date
    10-01-2010
    Location
    Bogota, Colombia
    MS-Off Ver
    Excel 2010 64 bit and Excel 2007,
    Posts
    1,377

    Compare Two Sheets and Highlight Differences

    Hi Guys,

    I have been given a task at work which I am having trouble coming up with a suitable solution for and wondered if someone may have done this before or could recommend a VBA approach.

    I am trying to compare two sheets within the same workbook (Sheet1 = New and Sheet2 = Old)

    Both sheets contain user records in col A

    I don't want to change anything in the New Sheet, but I want to compare the user records with the old records and if there are any updates, deletions/modifications between the records, I want to highlight them in yellow on the New sheet. It might also be good to extract any records which have changed to another Sheet so I can identify how many records have changed. Does this sound possible?

    I have attached a workbook to demonstrate the data.

    Any help would be welcomed. Many thanks for looking
    Last edited by Blake 7; 01-12-2015 at 11:43 AM.
    Blake 7

    If your question has been answered, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

    If any member's response has helped to solve your problem, please consider using the scales icon on the top right of their post to show your appreciation.

    http://failblog.org/

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

    Re: Compare Two Sheets and Highlight Differences

    Since you cannot use sheet reference of ther sheet in CF you must use named references.

    I named A column of Old sheet as UserID and whole table as WholeTable.

    Then use this in CF:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

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

    Re: Compare Two Sheets and Highlight Differences

    P.S. as I see UserID is unique value and it taken as identifier so it won't work if duplicated UserID can appear.

  4. #4
    Valued Forum Contributor Blake 7's Avatar
    Join Date
    10-01-2010
    Location
    Bogota, Colombia
    MS-Off Ver
    Excel 2010 64 bit and Excel 2007,
    Posts
    1,377

    Re: Compare Two Sheets and Highlight Differences

    Hi Zbor - I hope that you are your family are keeping well. Many thanks for taking the time to upload this spreadsheet. Very kind of you. All the best D

  5. #5
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Compare Two Sheets and Highlight Differences

    This code will show in sheet 1 columns "A to E", the ID Values, and the Corresponding addresses for Sheet "Old" and Sheets "New" where there is not a Match.
    Please Login or Register  to view this content.
    Regards Mick
    Last edited by MickG; 01-12-2015 at 11:19 AM.

  6. #6
    Valued Forum Contributor Blake 7's Avatar
    Join Date
    10-01-2010
    Location
    Bogota, Colombia
    MS-Off Ver
    Excel 2010 64 bit and Excel 2007,
    Posts
    1,377

    Re: Compare Two Sheets and Highlight Differences

    For anyone else looking for something similar but VBA based - I found this code online and amended it slightly. It doesnt export modified rows to another sheet but it does highlight them

    Please Login or Register  to view this content.

  7. #7
    Valued Forum Contributor Blake 7's Avatar
    Join Date
    10-01-2010
    Location
    Bogota, Colombia
    MS-Off Ver
    Excel 2010 64 bit and Excel 2007,
    Posts
    1,377

    Re: Compare Two Sheets and Highlight Differences

    Hi Mick - i've just seen your reply. Thats nice of you. I'll take a look now to be sure I understand it and have a little play.

    Thanks for taking the time to help me. Most appreciated.

    All the best

  8. #8
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Compare Two Sheets and Highlight Differences

    I've just noticed there is a "End If" missing from the end of the code. I've just added it to the Code I posted !!!!!

  9. #9
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Compare Two Sheets and Highlight Differences

    FWIW:

    Please Login or Register  to view this content.

  10. #10
    Valued Forum Contributor Blake 7's Avatar
    Join Date
    10-01-2010
    Location
    Bogota, Colombia
    MS-Off Ver
    Excel 2010 64 bit and Excel 2007,
    Posts
    1,377

    Re: Compare Two Sheets and Highlight Differences

    Hi Guys - thanks so much for all of your help. You have made my day a lot easier as my boss has stopped busting my B****!!! thanks so much!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. VBA to compare two sheets and highlight differences (basic test file attached)
    By Gti182 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-17-2015, 12:23 PM
  2. [SOLVED] Compare two sheets, highlight differences
    By papasmurfuo9 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 11-11-2014, 05:12 PM
  3. Replies: 9
    Last Post: 04-18-2013, 03:54 PM
  4. [SOLVED] Compare column on separate sheets in workbook and highlight differences
    By specialk610 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-22-2013, 03:57 PM
  5. Compare two sheets and highlight/mark differences
    By richarddd in forum Excel General
    Replies: 4
    Last Post: 04-03-2009, 09:54 AM

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