VBA macro to remove duplicates from each individual column [Excel]

VBA macro to remove duplicates from each individual column in excel sheet. This simple macro,  just single line syntax, treats each column as a separate entity and removes all duplicates from each column and keeps only unique values. Also see VBA macro to delete empty columns

vba-macro-remove-duplicates-each-column

VBA macro code to remove duplicates from each column

Sub removeDuplicatesFromEachIndividualColumn()
' Below VBA code removes the duplicates from each individual column in excel sheet
' Open the sheet in your workbook where you want to remove duplicates and run this macro
Columns.RemoveDuplicates Columns:=1, Header:=xlNo
End Sub

If you want to remove duplicates from a single column, you don’t need a macro. Follow below steps

Remove duplicates from a single column without VBA macro

  1. Select the column from which you want to delete duplicates
  2. Click on Data tab
  3. Click on Remove Duplicates under Data tools group

remove-duplicates-location-in-data-tab-microsoft-excel

About the Author

SRINI S

A passionate blogger. Love to share solutions and best practices on wordpress hosting, issues and fixes, excel VBA macros and other apps

Leave a Reply

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