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 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
- Select the column from which you want to delete duplicates
- Click on Data tab
- Click on Remove Duplicates under Data tools group