+ Reply to Thread
Results 1 to 8 of 8

How to remove only unique and keep duplicates

  1. #1
    Registered User
    Join Date
    09-09-2009
    Location
    RANCHO DOMINGUEZ, CA
    MS-Off Ver
    Excel 2007
    Posts
    12

    Thumbs up How to remove only unique and keep duplicates

    I have been trying for a day now to figure out how to remove the unique cells and keep the duplicates only. I have tried a macro but it does not seem to work. Has any one run into this before. I have attached a sample what I would like to do is remove all non-duplicates from column A. The only macro I could find was this:
    Please Login or Register  to view this content.
    But this did not work. Any Ideas would be much appreciated.
    Attached Files Attached Files
    Last edited by Leith Ross; 09-09-2009 at 06:28 PM. Reason: Added Code Tags

  2. #2
    Administrator JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: How to remove only unique and keep duplicates

    Let's be clear. If your list is:

    ACLU0403598
    ACLU0403598
    ACLU0403598

    ACLU0406600
    ACLU0406581
    ACLU0406581

    Then the only item you would want removed is ACLU0406600 (the red line)? We're keeping ALL instances of duplicates? Or are we keeping ONE instance of duplicates and removing the dupes AND unique values (the red and the blue lines)?

    When posting a sheet, BEFORE/AFTER examples make it clearest what you're after.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    “None of us is as good as all of us” - Ray Kroc
    “Actually, I *am* a rocket scientist.” - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    09-09-2009
    Location
    RANCHO DOMINGUEZ, CA
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: How to remove only unique and keep duplicates

    Then the only item you would want removed is ACLU0406600 (the red line)? Yes
    I would like only the red line removed and keep all instances of dups. I will be more clear next time.

  4. #4
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: How to remove only unique and keep duplicates

    Hi, Try:-
    Please Login or Register  to view this content.
    Regards Mick

  5. #5
    Registered User
    Join Date
    09-09-2009
    Location
    RANCHO DOMINGUEZ, CA
    MS-Off Ver
    Excel 2007
    Posts
    12

    Thumbs up Re: How to remove only unique and keep duplicates

    Quote Originally Posted by MickG View Post
    Hi, Try:-
    Please Login or Register  to view this content.
    Regards Mick
    That worked Thanks your great!

  6. #6
    Registered User
    Join Date
    09-09-2009
    Location
    RANCHO DOMINGUEZ, CA
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: How to remove only unique and keep duplicates

    Mick added the .EntireRow.Delete to remove the whole row hope this works. Thanks again.
    Last edited by shaunkimura; 09-09-2009 at 01:48 PM.

  7. #7
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: How to remove only unique and keep duplicates

    Hi, Try this, Results start "D2".
    Please Login or Register  to view this content.
    Regards Mick

  8. #8
    Registered User
    Join Date
    10-26-2010
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    3

    Smile Re: How to remove only unique and keep duplicates

    Hi Mick,

    Amazing! This worked wonderfully. Thank you! There is only one little glitch. In the results, there appears to be a few duplicates that were not in the original spreadsheet. I can simply filter it to remove the duplicates, correct?

    Original
    188 Abalgin
    15577 Abalgin
    61193 Abalgin


    Results from Macro
    188 Abalgin
    15577 Abalgin
    188 Abalgin
    61193 Abalgin

    I am a complete novice. Do you have any suggestions?

    Best,
    Terry

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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