+ Reply to Thread
Results 1 to 3 of 3

Find Duplicate in one column then compare to values in another

  1. #1
    Registered User
    Join Date
    06-28-2010
    Location
    Ohio
    MS-Off Ver
    Excel 2003
    Posts
    15

    Find Duplicate in one column then compare to values in another

    Hello,

    I am looking for a script that finds Duplicates in one column then if there is a match, looks at row B's value and deletes the row with the lowest value.

    I can write the if statements pretty easily for the last past of the script (comparing cells and then deleting), but am having trouble writing the first part that loops down through the first column.

    Essentially, I am looking for this:

    It would just loop down through the list once, and compare cell A1 to A2 to see if they are equal (if they are not then it would compare A2 to A3), if they are equal then it would compare B1 to B2, and if B1 is greater than B2, delete row 2, If B1 = B2 then delete row 2, else loops to compare A2 to A3.

    Once the delete occurs, it then goes back and compares A1 to the new A2 so it catches any additional duplicates. Or for simplicity, I just run the loop four or five times to catch all the duplicates.

    Thanks! in advance!

  2. #2
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Find Duplicate in one column then compare to values in another

    Clear as mud

  3. #3
    Forum Expert JasperD's Avatar
    Join Date
    05-07-2013
    Location
    Netherlands
    MS-Off Ver
    Excel 2016
    Posts
    1,393

    Re: Find Duplicate in one column then compare to values in another

    Would this do the trick?

    Please Login or Register  to view this content.
    Please click the * below if this helps

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. How to find duplicate values in another column
    By JessK in forum Excel General
    Replies: 2
    Last Post: 06-16-2014, 09:11 AM
  2. Replies: 7
    Last Post: 05-28-2014, 03:19 AM
  3. Find duplicate values for unique column
    By zammy73 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-24-2014, 06:45 PM
  4. Find duplicate values in a column, make each value unique.
    By jobell in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-19-2012, 12:15 PM
  5. Replies: 11
    Last Post: 11-03-2011, 09:18 PM

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