+ Reply to Thread
Results 1 to 14 of 14

Deleting Duplicate Entries

  1. #1
    Registered User
    Join Date
    05-07-2010
    Location
    Utah
    MS-Off Ver
    Excel 2003
    Posts
    11

    Deleting Duplicate Entries

    Im a total noob...sorry if this is a really basic question.


    I need help with sorting our company mailing list in Excel. Specifically I need help in deleting duplicate entries. I know how to delete duplicates but I don't know how to delete them in such a way that it deletes the entire row even though I am only deleting duplicates from a single column. Does that make sense? I want to be able to search the Address column for example and find duplicates but when I delete the duplicate Address's I want the entire row to delete with it (even if the rest of the entries i.e. Name or email address is different). This way when I delete them all the information still lines up.

    Thank you in advance!
    Last edited by kblinkin; 05-21-2010 at 05:08 PM.

  2. #2
    Forum Expert contaminated's Avatar
    Join Date
    05-07-2009
    Location
    Baku, Azerbaijan
    MS-Off Ver
    Excel 2013
    Posts
    1,430

    Re: Deleting Duplicate Entries

    Try it out

    Please Login or Register  to view this content.
    Last edited by contaminated; 05-07-2010 at 03:29 PM.
    Люди, питающие благие намерения, как раз и становятся чудовищами.

    Regards, ?Born in USSR?
    Vusal M Dadashev

    Baku, Azerbaijan

  3. #3
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: Deleting Duplicate Entries

    You could easily do this without VBA by using Advanced Filter with the option to copy unique values to a new location.

    If this is something you will do often, automating Advanced Filter is faster than looping through a lot of cells.

    Excel Advanced Filter
    Palmetto

    Do you know . . . ?

    You can leave feedback and add to the reputation of all who contributed a helpful response to your solution by clicking the star icon located at the left in one of their post in this thread.

  4. #4
    Registered User
    Join Date
    05-07-2010
    Location
    Utah
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Deleting Duplicate Entries

    Hey! Thank you for that code. Once again I am a noob, can you direct me on how to apply it?

  5. #5
    Forum Expert contaminated's Avatar
    Join Date
    05-07-2009
    Location
    Baku, Azerbaijan
    MS-Off Ver
    Excel 2013
    Posts
    1,430

    Re: Deleting Duplicate Entries

    Palmetto

    Originally Posted By kblinkin
    but when I delete the duplicate Address's I want the entire row to delete with it (even if the rest of the entries i.e. Name or email address is different).
    Thats why I posted macro. As I know advanced filter doesnt get unique values from multiple columns...

  6. #6
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: Deleting Duplicate Entries

    Thats why I posted macro. As I know advanced filter doesnt get unique values from multiple columns...
    Got too focused on this and overlooked the multi-column aspect of the issue.
    even though I am only deleting duplicates from a single column
    Last edited by Palmetto; 05-07-2010 at 04:16 PM.

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

    Re: Deleting Duplicate Entries

    General rule of thumb, when offering macros in the non-programming forum, especially to self-professed Excel newbies, always include a boilerplate instruction set on how to install/activate them.

    Something like:
    ============
    How/Where to install the macro:

    1. Open up your workbook
    2. Get into VB Editor (Press Alt+F11)
    3. Insert a new module (Insert > Module)
    4. Copy and Paste in your code (given above)
    5. Get out of VBA (Press Alt+Q)
    6. Save as a macro-enabled workbook

    The macro is installed and ready to use. Press Alt-F8 and select it from the macro list.
    _________________
    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!)

  8. #8
    Registered User
    Join Date
    05-07-2010
    Location
    Utah
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Deleting Duplicate Entries

    Thank you very much, I will give this a try and get back to you...

  9. #9
    Registered User
    Join Date
    05-07-2010
    Location
    Utah
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Deleting Duplicate Entries

    Wow! Works like a charm... Thank you all very much

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

    Re: Deleting Duplicate Entries

    If that takes care of your need, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

  11. #11
    Registered User
    Join Date
    05-07-2010
    Location
    Utah
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Deleting Duplicate Entries

    Actually, I just realized that maybe this didn't work exactly right. To test it I had grabbed maybe 10 names from the address list and created a new list. I then grabbed a few rows and duplicated them. Then I applied the Macro. It WORKED! However, when I applied it to the master list it doesn't actually delete any duplications. The only difference between the two lists is that one the test lists I copied the entire row so the entire row was duplicated, whereas on the master list the duplicates aren't across the entire row but in a single column. Does that have anything to do with it? What I need is for it to detect duplicates in any given column regardless of whether the rest of the row is duplicate. Does that make sense? Thank you for your continued help

  12. #12
    Registered User
    Join Date
    05-07-2010
    Location
    Utah
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Deleting Duplicate Entries

    Can we get any other help on this? I am still in need of something that works...anyone?

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

    Re: Deleting Duplicate Entries

    Assuming that:

    1) Row 1 is titles, not part of the data, then we can use an autofilter to delete all the duplicates all at once.
    2) You want to keep the first instance of each value in the designated column (MyCol in the macro)
    3) You edit this macro so that MyCol is the column number you wish to evaluate by

    Please Login or Register  to view this content.

  14. #14
    Registered User
    Join Date
    05-07-2010
    Location
    Utah
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Deleting Duplicate Entries

    Great! This worked fantastic! Kudos for you and everyone that helped

+ 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