Macro To Compare Two Excel WorkSheets And Copy Duplicate Rows To New WorkSheet

Previously, we wrote a macro on comparing two excel worksheets and highlight duplicate entries.  Some of our readers were looking for an enhancement of this macro and the exact requirement is as below:

Compare two excel worksheets, highlight the duplicate rows and copy them to a new excel worksheet

The macro we had previously was comparing & highlighting individual cells and not rows. So, we modified this macro to suit the requirement stated above and here is the solution.

Note: To find out the detailed steps on how to create, run or edit a macro, you may refer here.

Few Points Worth To Note:

  • While creating the Macro, ensure that name of the macro is kept as “compare”
  • Worksheet names are considered to be “Sheet1″, “Sheet2″ and “Sheet3″
  • Duplicate rows are highlighted in Sheet1 and copied to Sheet3

Hope you find this solution useful, your suggestions, feedback and comments are always welcome.

  1. The other macro compare and highlights duplicate cells while this one looks for duplicate rows and copies to a third sheet. What I would like to do is compare for matching names and birthdays between two worksheets and copy both rows to a third sheet for additional review. Any help would be appreciated.

Leave a Reply

Your email address will not be published. Required fields are marked *


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">