Results 1 to 2 of 2

Delete both duplicate rows

Threaded View

  1. #1
    Registered User
    Join Date
    11-17-2013
    Location
    Buenos Aires, Argentina
    MS-Off Ver
    Excel 2003
    Posts
    1

    Delete both duplicate rows

    Hello

    I have a list of emails. In it there are many duplicated addresses and I need to remove both duplicates, and leave the list with only the unique addresses.

    I would need a macro that deletes both rows of the same address.

    Here is one, but it doesn't work or I am doing something wrong:

    Sub aaa()
      For i = Cells(Rows.Count, 1).End(xlUp).Row To 2 Step -1
        If Cells(i, 1) = Cells(i - 1, 1) And Cells(i, 2) = Cells(i - 1, 2) Then
          Cells(i, 1).EntireRow.Delete
          Cells(i - 1, 1).EntireRow.Delete
        End If
      Next i
    End Sub
    Any help?
    Many thanks.
    Last edited by alansidman; 11-17-2013 at 01:20 PM. Reason: code tags added

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Delete rows based on duplicate cell, but leaving first and last duplicate.
    By LadyNicole in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-28-2013, 05:07 AM
  2. VBA helps needed to Sum duplicate values and delete duplicate rows
    By krjoshi in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-03-2013, 11:40 PM
  3. Replies: 5
    Last Post: 11-12-2012, 08:38 PM
  4. [SOLVED] Sum Duplicate values then delete duplicate rows
    By keekdapolak in forum Excel General
    Replies: 7
    Last Post: 09-20-2012, 02:57 PM
  5. delete duplicate rows, delete empty rows
    By loade in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 05-03-2012, 05:42 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1