removing duplicates

markster

Well-known Member
Joined
May 23, 2002
Messages
575
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

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.

Peter_SSs

MrExcel MVP, Moderator
Joined
May 28, 2005
Messages
57,397
Office Version
  1. 365
Platform
  1. Windows
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
 

Lewiy

Well-known Member
Joined
Jan 5, 2007
Messages
4,284
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
 

Forum statistics

Threads
1,181,649
Messages
5,931,216
Members
436,784
Latest member
amuljono

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
Top