This Excel VBA procedure will remove all of the duplicate values in multiple columns. Since Excel 2010 we have been able to remove the duplicates in a column. With the assistance of VBA we can automate this task to remove all of the duplicates in all of the columns or you can choose which columns to remove the duplicate values from.
The following is the Excel VBA code which remove all duplicates in all of the columns of a particular sheet.
Dim rng As Range
Dim i As Integer
Dim Cols As Variant
Set rng = [A1].CurrentRegion
ReDim cols(0 To rng.Columns.Count - 1)
For i=0 To UBound (cols) 'Loop for all columns
cols(i)=i + 1
rng.RemoveDuplicates Columns:=(cols), Header:=xlYes
As I have used the current region I have made the assumption that headers are on the top row (fair assumption as this is where they should be) . If for some new age reason you do not have headers then remove the last part.
If you wanted to remove the duplicates in say columns (1, 2, 3) then the following would help.
Cells.RemoveDuplicates Columns:=Array(1, 2, 3), Header:=xlYes
Change the columns to suit - ie. 1, 2, 3 becomes the columns you are interested in deleting.