+ Reply to Thread
Results 1 to 9 of 9

VBA to highlight differences between 2 tabs of data

  1. #1
    Forum Contributor
    Join Date
    05-01-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    822

    VBA to highlight differences between 2 tabs of data

    In the attached workbook i have 2 tabs of data, current & previous.

    I would like to write some code which compares to 2 sets of data and then highlights the difference between both tabs on the 'differences' tab.

    Is this possible?

    Regards
    Attached Files Attached Files

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,529

    Re: VBA to highlight differences between 2 tabs of data

    If current is different to prior, what would you show on the difference tab?
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: VBA to highlight differences between 2 tabs of data

    Hello kenadams378,

    Do you really need VBA for this, if it can be done as demonstrated in the attached sample Workbook?

    Regards.
    Attached Files Attached Files
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,529

    Re: VBA to highlight differences between 2 tabs of data

    Maybe this to start you off:

    Please Login or Register  to view this content.

    Regards, TMS

  5. #5
    Forum Contributor
    Join Date
    05-01-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    822

    Re: VBA to highlight differences between 2 tabs of data

    Thanks for your replies.

    I just need to highlight the fect there are differences so some conditional formatting or true/false for each cell.

    The one issue i do have is that the files i will be using will have differences in range, could this be incorporated?

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,529

    Re: VBA to highlight differences between 2 tabs of data

    This would just highlight differences without any specific values:

    Please Login or Register  to view this content.

    As for different size ranges, how does that work for you? I made the assumption that you simply needed to compare row by row, as did Winon. If that's not the case, it's a completely different problem.

    Could there be rows added and deleted, as well as differences? For that, you'd need some sort of key field so that you could locate a "matching" row and then do the comparison.

    If it's just a case of more rows on the current sheet, the range to be checked could be made to depend on the number of rows in the current worksheet. Of course, every cell would be marked as different.

    One row of test data doesn't really reflect the complexity of the task.

    Regards, TMS

  7. #7
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,529

    Re: VBA to highlight differences between 2 tabs of data

    Please Login or Register  to view this content.

    Regards, TMS

  8. #8
    Forum Contributor
    Join Date
    05-01-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    822

    Re: VBA to highlight differences between 2 tabs of data

    Many thanks for this. Works a treat.

  9. #9
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,529

    Re: VBA to highlight differences between 2 tabs of data

    You're welcome.

+ 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. highlight differences of data on 2 sheets
    By steve111 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-04-2014, 11:21 AM
  2. [SOLVED] VBA to validate data & highlight differences
    By kenadams378 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 02-19-2013, 07:09 AM
  3. [SOLVED] How do I compare 2 sets of data and highlight differences?
    By Perplexed1 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 04:05 AM
  4. [SOLVED] How do I compare 2 sets of data and highlight differences?
    By Perplexed1 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 01:05 AM
  5. [SOLVED] How do I compare 2 sets of data and highlight differences?
    By Perplexed1 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-08-2005, 08:15 PM

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