+ Reply to Thread
Results 1 to 7 of 7

Compare lists and extract differences

  1. #1
    Registered User
    Join Date
    06-01-2015
    Location
    Derby, England
    MS-Off Ver
    2013
    Posts
    87

    Compare lists and extract differences

    I have piece of code in a workbook that brings in new data to a worksheet and then performs some actions to create a report on a different sheet. Each time the spreadsheet opens the data refreshes and may or may not bring in new data.

    I need to compare the two lists and update my report using only new values.

    In the attached example I need to compare the list in 'Master' to the list in 'dB Dump'. It should result in the answer in 'New Refs'. I only care if the are in 'dB dump' and not in 'Master', I do not care of there are references in 'Master' that are not in 'dB dump'. I hope that makes sense.

    Would anybody have an idea of how to code this in VBA?

    Any and all help appreciated.

    Ed
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor Gatti's Avatar
    Join Date
    06-08-2015
    Location
    Brasil, São Paulo, Ribeirão Preto
    MS-Off Ver
    365
    Posts
    346

    Re: Compare lists and extract differences

    Hello!

    Try this:

    Please Login or Register  to view this content.
    If I have solved your question, please mark the thread as [SOLVED],
    And consider adding reputation

    ?Simplicity is the ultimate sophistication? (Leonardo Da Vinci)

    Regards,
    F?bio Gatti

    https://www.youtube.com/pulodogatti
    https://www.linkedin.com/in/fabiocgatti/
    https://instagram.com/pulodogatti

  3. #3
    Registered User
    Join Date
    05-12-2015
    Location
    AU
    MS-Off Ver
    2019
    Posts
    61

    Re: Compare lists and extract differences

    I am just new to VBA/macro and I am looking of a code similar to this.
    I tried the above code but it only copied all entries on Master worksheet to New Refs worksheet. I am not sure if I do it right.

  4. #4
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Compare lists and extract differences

    Here you go ejon

    Please Login or Register  to view this content.
    @Gatti. Your code is sound except for you were returning positive results rather than the ones that weren't found in RangeDump. This can be easily corrected by removing the "Not" in this line
    Please Login or Register  to view this content.
    @rxk. Start a new thread with your question. PM me the link and I will look at it.
    If you are happy with my response please click the * in the lower left of my post.

  5. #5
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,835

    Re: Compare lists and extract differences

    Try
    Please Login or Register  to view this content.
    Attached Files Attached Files

  6. #6
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,835

    Re: Compare lists and extract differences

    In case of a huge data.
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    06-01-2015
    Location
    Derby, England
    MS-Off Ver
    2013
    Posts
    87

    Re: Compare lists and extract differences

    Thank you all for responding. I managed to get Gatti's method to work with a little tweak to clear previous results on each refresh.

    Ed

+ 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. Replies: 0
    Last Post: 04-13-2015, 01:01 PM
  2. Is it possible to compare two sheets and extract out the differences?
    By dwx in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-03-2014, 11:51 AM
  3. Excel 2010 Formula - compare lists to determine differences
    By t.regi in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 12-19-2013, 11:51 PM
  4. Compare two lists and highlight the differences
    By jsmo in forum Excel General
    Replies: 3
    Last Post: 08-28-2012, 10:27 PM
  5. Compare and Display Similarities/Differences in two lists.
    By mrgillus in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-24-2009, 02:50 PM
  6. Compare two lists and highlight differences.
    By delgadotb in forum Excel General
    Replies: 1
    Last Post: 03-30-2009, 03:24 PM
  7. compare lists, extract new values
    By trav in forum Excel General
    Replies: 1
    Last Post: 05-16-2006, 11:22 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