ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   How am I able to del duplicate lines automatically (https://www.excelbanter.com/excel-worksheet-functions/165773-how-am-i-able-del-duplicate-lines-automatically.html)

Kupa72

How am I able to del duplicate lines automatically
 
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?

ryguy7272

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?



All times are GMT +1. The time now is 07:29 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com