How to delete repeted rows automaticaly?

  • Thread starter Thread starter gabarrao
  • Start date Start date
G

gabarrao

Hello,

I have a very big list of adresses and phones. There are a lot o
repeted data in it.
I would like to know if there is a way to erase the repeted rows of m
list automaticaly. If it is possible, how can I do it?

Thanks very much.

Matheu
 
I would sort the rows (Data, Sort) and then delete the duplicated rows which
will be obvious. Take a note of the original row sequence before the first
sort so you can reresort it back to the original sequence after the deletion
(if required).
 
Hello,

I have already done this. But even this way the list is too big.
would like to find and automatic way.

Thanks very much,

Matheu
 
gabarrao said:
Hello,

I have already done this. But even this way the list is too big. I
would like to find and automatic way.

Thanks very much,

Matheus

This macro assumes your data starts at row 1, that column A is the one you
want to test for duplicates and that the data has been sorted on column A.
Change the Row= and Col= lines to change the target cells.

It will keep the first row of any dupes and continue until it finds a 2
blank cells.

Sub deletedupes()
Row = 1
Col = 1
Do Until Cells(Row, Col).Value = ""
Cells(Row + 1, Col).Activate
If Cells(Row + 1, Col) = Cells(Row, Col) Then
ActiveCell.EntireRow.Delete
Else
Row = Row + 1
End If
Loop
End Sub

Ian
 

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