+ Reply to Thread
Results 1 to 10 of 10

VBA to compare and highlight differences

  1. #1
    Registered User
    Join Date
    08-01-2013
    Location
    Houston, TX
    MS-Off Ver
    Excel 2010
    Posts
    6

    VBA to compare and highlight differences

    Hi Everyone! I haven't been able to find what I'm looking for so maybe someone might be able to help. I have to worksheets I get from two different dbases do the output is slightly different in each. What I need is simple, (I think). Just need to get a VBA that looks from Sheet1 to Sheet2 for a doc number. If it's not on Sheet 2, simply highlight it BLUE on Sheet, AND then looks from Sheet2 to Sheet1, and if it's not on Sheet1, then highlight the entry on Sheet2 GREEN.

    I.E.

    SHEET1 SHEET2
    COL A COL A

    11111 AAAAA
    22222 BBBBB
    33333 11111
    AAAAA 44444


    Thank All!!!
    Attached Files Attached Files

  2. #2
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,758

    Re: VBA to compare and highlight differences

    Perhaps a macro like this?

    Please Login or Register  to view this content.
    Alf

  3. #3
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: VBA to compare and highlight differences

    Or this?

    Please Login or Register  to view this content.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  4. #4
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,820

    Re: VBA to compare and highlight differences


  5. #5
    Forum Contributor
    Join Date
    10-04-2010
    Location
    London
    MS-Off Ver
    Office 365
    Posts
    455

    Re: VBA to compare and highlight differences

    Came across this old thread.

    Can this code be easily adapted to do the same but rather than just comparing column A to compare A:E?

  6. #6
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: VBA to compare and highlight differences

    Maybe:

    Please Login or Register  to view this content.
    but - you should start your own thread and post a sample book

  7. #7
    Forum Contributor
    Join Date
    10-04-2010
    Location
    London
    MS-Off Ver
    Office 365
    Posts
    455

    Re: VBA to compare and highlight differences

    works perfectly thanks xladept

  8. #8
    Forum Contributor
    Join Date
    10-04-2010
    Location
    London
    MS-Off Ver
    Office 365
    Posts
    455

    Re: VBA to compare and highlight differences

    applied the code to a larger data set and the compare doesn't seem to flag up the differences. Can't quite figure out why...

    Are there any limitations with the code which would only flag up a portion of the differences or none at all with the code running through without errors?

    If i can't find an answer i'll post up a separate thread

  9. #9
    Forum Contributor
    Join Date
    10-04-2010
    Location
    London
    MS-Off Ver
    Office 365
    Posts
    455

    Re: VBA to compare and highlight differences


  10. #10
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: VBA to compare and highlight differences

    You're welcome and thanks for the rep! I'll look at the new post later.

+ 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. Compare two lists and highlight the differences
    By jsmo in forum Excel General
    Replies: 3
    Last Post: 08-28-2012, 10:27 PM
  2. Compare 2 Workbooks and Highlight Differences
    By LabanM in forum Excel General
    Replies: 3
    Last Post: 10-19-2010, 11:34 AM
  3. Compare two lists and highlight differences.
    By delgadotb in forum Excel General
    Replies: 1
    Last Post: 03-30-2009, 03:24 PM
  4. Compare Two Worksheets:highlight the differences
    By Jim in forum Excel General
    Replies: 1
    Last Post: 10-11-2005, 04:05 PM
  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