removing duplicates

markster

Well-known Member
Joined
May 23, 2002
Messages
579
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
Hi - I have a 50,000 lines of data. I just need a bit of macro code to look at column C and remove any duplicate lines. i.e if the full name in column C is a duplicate then to remove the row so I ensure that I have a list without duplicates.
Thanks
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
I'm not sure that we have a full picture of what you have or what you are trying to achieve, but have a look at Data|Filter|Advanced Filter...|Unique records only and see if that is any use
 
Upvote 0
Try this:
Code:
Sub Duplicates()
Dim a As Long
Dim c As Long
a = Cells(Rows.Count, 3).End(xlUp).Row
For c = a To 1 Step -1
    If WorksheetFunction.CountIf(Range("C1:C" & c), Cells(c, 3)) > 1 Then
        Rows(c).Delete shift:=xlUp
    End If
Next c
End Sub
 
Upvote 0

Forum statistics

Threads
1,222,022
Messages
6,163,454
Members
451,837
Latest member
gmc

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top