PDA

View Full Version : Remove duplicated rows with VBA



mimoka82
05-25-2021, 10:03 AM
Hi Guys,

I'm new to this forum and I'm trying to accelerate on VBA after start learning it. May I kindly ask some help? Anybody had any suggestions how to remove duplicated rows with VBA i.e. related coding

Thank you in advance!
Gergely

anish.ms
05-25-2021, 10:30 AM
Hi,
Why do you need VBA to do this?
It is already there under Data > Remove Duplicates, and then Under Columns, check or uncheck the columns where you want to remove the duplicates
A sample code to remove duplicates comparing multiple columns


Sub RemoveDups_MultColumns()
ActiveSheet.UsedRange.RemoveDuplicates Columns:=Array(1, 2) , Header:=xlYes
End Sub