How am I able to del duplicate lines automatically

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need to clean up/separate information from file that contains more that
100.000 rows. There is cells that contains same information, and I want to
move all rows within same information in different location than unique rows.
Any ideas?
 
Use Advanced Filter under Data > Filter > Advanced Filter, then check box for
'Unique Records Only'.


Alternatively, you can run this macro, after you have sorted all the columns
(in the case I am giving you, it is Column A that is checked for
dupes...change to suit your needs):

Sub CheckForDupes()

Dim RowNdx As Long
Dim ColNum As Integer
ColNum = Selection(1).Column 'set number to match the proper column
For RowNdx = Selection(Selection.Cells.Count).Row To _
Selection(1).Row + 1 Step -1
If Cells(RowNdx, ColNum).Value = Cells(RowNdx - 1, ColNum).Value Then
Cells(RowNdx, ColNum).Delete shift:=xlUp
End If
Next RowNdx
End Sub

Regards,
Ryan---
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top