Data Comparison from Two Sheets

  • Hello,


    I am looking to have a hotkey-based macro that will compare the data in Sheet2 and the data in Sheet "Masterlist", then delete the matches found in Sheet2. If the data doesn't match in the three provided columns, it would not delete the rows.


    Attached is an example of the format. The important columns are filled out, columns D, E and F.


    Thank you for any help!

    Files

    • Test.xlsx

      (10.31 kB, downloaded 84 times, last: )
  • Re: Data Comparison from Two Sheets


    Try this

  • Re: Data Comparison from Two Sheets


    Ah!


    I completely forgot to include the H column.. which also caused me to remember that sheet2 would have filtered data. Can a macro only find duplicates in filtered data without removing the filter?


    Thank you for the help!

  • Re: Data Comparison from Two Sheets


    Quote from JSpectrum;584565

    Ah!


    I completely forgot to include the H column.. which also caused me to remember that sheet2 would have filtered data. Can a macro only find duplicates in filtered data without removing the filter?


    Thank you for the help!


    Bump.

  • Re: Data Comparison from Two Sheets


    Is this what you are after?

  • Re: Data Comparison from Two Sheets


    The sheet1 has the filtered data in this instance. Would I just change...


    Code
    1. With Sheets("MasterList").AutoFilter.Range

    to


    Code
    1. With Sheets("Sheet1").AutoFilter.Range


    ?

  • Re: Data Comparison from Two Sheets


    Can you post a sample workbook of the change, or explain in better detail what it is doing. The macro can be modified to accomodate, but I want to be sure to make the right alterations.

  • Re: Data Comparison from Two Sheets


    An example is attached. As you can see, sheet2 is the filtered data. It would match what's in the master list, then delete the matches from sheet2. I have also include the latest macro that you provided.


    Thank you

    Files

    • Test2.xlsm

      (16.03 kB, downloaded 87 times, last: )
  • Re: Data Comparison from Two Sheets


    That makes it much different than the original scenario. You cannot simply just do a compare and replace since the data being deleted is filtered and not all values are showing. This would eliminate all data that is currently filtered.

  • Re: Data Comparison from Two Sheets


    Try this (briefly tested)
    notify if any bugs