Create Delete Duplicate Macro

Posted on 2006-04-05
Last Modified: 2008-03-10
I am trying to write a macro in excel, but I would like to do all this in access because I am taking this table from access pasting into excel and trying to delete duplicates by choosing the unique records.  The trouble I am facing is that even when I advance filter for unique records, it does not delete all duplicates.  

I have a table:

Date   ID   Facility
xxx   xx   xxx

I want to find any duplicates in the ID column then delete the entire row where the duplication is found.  Can I do this?
Question by:Namrac00
    LVL 92

    Expert Comment

    by:Patrick Matthews
    Hi Namrac00,

    You should develop a query that returns only unique rows, and export that query to Excel.


    LVL 65

    Accepted Solution

    tell u what, use the query wizard to produce a find duplicates query

    then take that query, nick the WHERE clause from it
    and do this

    DELETE FROM table ....


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    Suggested Solutions

    It took me quite some time to sort out all the different properties of combo and list boxes available from Visual Basic at run-time. Not that the documentation is lacking: the help pages are quite thorough and well written. The problem was rather wh…
    Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
    In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
    With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now