Range.RemoveDuplicates (Excel)

Removes duplicate values from a range of values.

RemoveDuplicates (Columns, Header)


ActiveSheet.Range("A1:C100").RemoveDuplicates Columns:=Array(1,2), Header:=xlYes

Arguments

Optional arguments

The following arguments are optional

Columns - Array of indexes of the columns that contain the duplicate information

Header (XlYesNoGuess) - Specifies whether the first row contains header information. xlNo is the default value; specify xlGuess if you want Excel to attempt to determine the header.

Possible return values are xlGuess - Excel determines whether there is a header, and where it is, if there is one, xlNo - Default. The entire range should be sorted, xlYes - The entire range should not be sorted.