Extract Duplicates VBA

  • Hi All,


    I have put together a macro to find and extract duplicates of more than 1 instance from two sheets and copy them to a new sheet.


    It works fine but the copy duplicate part of the macro is extremely inefficient.


    Any help to make this code more efficient would be greatly appreciated.


    See attached.

    Files

  • See if this is better



  • Pleased to help. The code is faster because it doesn't move duplicates one by one but builds one range containing all the duplicates, then moves them all together. If you want to clear the duplicates from the other sheet then you can use Excel's inbuilt remove duplicates feature.


    Code
    1. ActiveSheet.RemoveDuplicates Columns:=1, Header:=xlYes


    Post back if you need further help.


    Visit my web site, http://www.excel-it.com, for more examples and some helpful articles.