View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
ryguy7272 ryguy7272 is offline
external usenet poster
 
Posts: 2,836
Default How am I able to del duplicate lines automatically

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---

--
RyGuy


"Kupa72" wrote:

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?