Skip to content

Excel VBA – How to Remove Duplicates with VBA Macro

    Remove Duplicates

    Use the RemoveDuplicates method of the Range object.

    expression .RemoveDuplicates(Columns, Header)

    The code below refers to the data shown above

    Remove Duplicates from a Single Column

    Range("A1").CurrentRegion.RemoveDuplicates Columns:=1,Header:=xlYes

    Remove Duplicates from Multiple Columns Using Array

    Range("C1").CurrentRegion.RemoveDuplicates Columns:=Array(1, 2), Header:=xlYes