Results 1 to 5 of 5

Removing Duplicates VBA Not Optimized

Threaded View

  1. #1
    Registered User
    Join Date
    07-21-2021
    Location
    United States
    MS-Off Ver
    365
    Posts
    1

    Removing Duplicates VBA Not Optimized

    Hello, new to Macros here. I have a simple spreadsheet of contacts with column headers such as name, email, company, etc.

    I am trying to write a simple script that will look for duplicate email addresses (which are in column 3) and delete one of the duplicate rows. My code seems to work, but I need to run it like 5x to fully clean the list for some reason. It should be able to remove all duplicates in one run. Any help is greatly appreciated.
    Sub DuplicateRemove()
    
    Dim i As Integer
    
    For i = 1 To 400
        For j = i + 1 To 400
            If Worksheets("Sheet1").Cells(i, 3).Value = Worksheets("Sheet1").Cells(j, 3).Value Then Rows(j).EntireRow.Delete
        Next j
    Next i
    
    End Sub
    Last edited by alansidman; 07-22-2021 at 07:23 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Remove duplicates not removing duplicates bug, so what???!!!
    By abdelrazzaq in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 12-19-2016, 01:43 PM
  2. [SOLVED] removing duplicates only within duplicates on another column
    By eculver in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-10-2016, 08:08 PM
  3. Remove duplicates function not removing duplicates
    By Berilium2 in forum Excel General
    Replies: 3
    Last Post: 04-01-2015, 06:55 AM
  4. Replies: 6
    Last Post: 03-29-2012, 12:16 AM
  5. [SOLVED] Removing Duplicates
    By sat in forum Excel General
    Replies: 5
    Last Post: 06-18-2005, 07:05 PM
  6. [SOLVED] Removing Duplicates
    By sat in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-18-2005, 07:05 PM

Tags for this Thread

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