+ Reply to Thread
Results 1 to 4 of 4

Finding Duplicates - and deleting entire row

  1. #1
    Registered User
    Join Date
    12-17-2009
    Location
    US
    MS-Off Ver
    Excel 2003
    Posts
    5

    Finding Duplicates - and deleting entire row

    Hi - I would like to do a search in my Excel Doc by finding duplicate records from the column Product Name. If there are duplicates, I don't want to just delete the field I want to delete the entire row. Is there a way to do that? The duplicate formula only deletes the field and then mismatches all my records. Any ideas? Thanks!

  2. #2
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,496

    Re: Finding Duplicates - and deleting entire row

    Here is how I would approach it, if Product Name is in column C, then I'd put this in another cell =countif($C$2:C2,C2) and copy down. This will put a 1 in every row that does not have a duplicate. Then I'd copy and paste special values where the numbers were. Then resort based on the values in descending order and you'd have the duplicates at the top, then highlight those rows and delete.
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  3. #3
    Forum Expert
    Join Date
    11-26-2013
    Location
    Colac, Victoria, Australia
    MS-Off Ver
    Excel 2016
    Posts
    1,309

    Re: Finding Duplicates - and deleting entire row

    Here is another approach - along the same lines as Sambo Kid.

    =IF(COUNTIF($C$2:C2,C2)>1,"D",1)

    This will force a "D" (for delete) where there are multiples.

    Now highlight the new column, and hit F5 - you will see the Go To dialog box. Click on Special... and Click the Formulas radio button. Remove the tick next to Numbers and click OK.

    All the Ds will be selected.

    Now just Delete the rows.

    The only advantage of this method is that you don't have to re-sort your data.

    I hope this helps, please let me know!

    Regards,

    David


    - Please click on the *Add Reputation button at the bottom of helpful responses.

    Please mark your thread as SOLVED:
    - Click Thread Tools above your first post, select "Mark your thread as Solved".


  4. #4
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Finding Duplicates - and deleting entire row

    Hi Terp,

    Try:

    Please Login or Register  to view this content.
    If you haven't used macros before you'll need to go to:
    File- options - trust center -trust center settings - macro settings ,
    the second option down (disable all macros with notification)

    Then - Copy the code to the clipboard

    Open your Workbook

    Press ALT + F11 to open the Visual Basic Editor.

    Select "Module" from the Insert menu

    Type "Option Explicit" then paste the code under it

    With the cursor between Sub and End Sub press F5 (F8 to Single Step)

    OR

    Press ALT + Q to close the code window.

    Press ALT + F8 then double click on the macro name
    *Be sure to save the book with the code as Macro-Enabled
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

+ 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. Finding and deleting duplicates.
    By 54ed in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-23-2015, 12:24 PM
  2. Finding & Deleting Duplicates in a List
    By dsciola in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 07-12-2013, 01:16 PM
  3. [SOLVED] Macro for finding duplicates then deleting the row
    By adamj1910 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-17-2012, 04:11 AM
  4. Finding and deleting duplicates
    By Myrkk in forum Excel General
    Replies: 4
    Last Post: 03-31-2011, 07:39 PM
  5. Finding and deleting duplicates across two workbooks?
    By doubleudee in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-17-2008, 08:45 AM
  6. Finding Duplicates & Deleting the ROw
    By samtwilliams in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-19-2007, 05:07 PM
  7. Finding and Deleting duplicates in a column
    By Brian in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-05-2005, 11:06 AM

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