+ Reply to Thread
Results 1 to 11 of 11

Macro to Filter and Delete Row for Duplicate Entries

  1. #1
    Forum Contributor
    Join Date
    11-02-2010
    Location
    Philippines
    MS-Off Ver
    Excel 2003
    Posts
    353

    Macro to Filter and Delete Row for Duplicate Entries

    Hi Everyone,
    I would like to seek help filtering some of my Data using Macro.
    Typically on my Excel Sheet, I have Data on Columns A, B and C.
    Could you help me filter and delete the row if there's a duplicates on Column C?

    Doing some reporting and I could really save so much time if there's a way to automate this using a Macro script. Kindly help. Thank you in advance.

    (I have attached my dummy work sheet).

    Regards,
    Andrew
    Attached Files Attached Files
    Last edited by Andrew.Trevayne; 09-29-2011 at 11:00 AM.

  2. #2
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Macro to Filter and Delete Row for Duplicate Entries

    hi, Andrew.Trevayne, please check attachment, run code "test"
    Attached Files Attached Files
    Last edited by watersev; 09-29-2011 at 06:05 AM.

  3. #3
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Macro to Filter and Delete Row for Duplicate Entries

    Andrew,

    Alternate method:
    Please Login or Register  to view this content.


    Hope that helps,
    ~tigeravatar

  4. #4
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Macro to Filter and Delete Row for Duplicate Entries

    Tigeravatar,

    What does intersect do? Is it available only in 2010?

  5. #5
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Macro to Filter and Delete Row for Duplicate Entries

    arlu1201,

    Intersect is available from Excel 97 and up I believe. (I haven't actually used earlier than Excel 2003).

    To quote cpearson at http://www.cpearson.com/excel/Events.aspx :
    "Intersect returns a range of cells that are included in two ranges. For example, the Intersection of the range A1:C3 and C3:F6 is the cell C3 since that cell is common to both ranges. If there are no cells in common between two ranges, Intersect returns Nothing"

    Hope that helps,
    ~tigeravatar

  6. #6
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Macro to Filter and Delete Row for Duplicate Entries

    Under certain conditions:

    Please Login or Register  to view this content.
    less restricted:
    Please Login or Register  to view this content.
    Last edited by snb; 09-29-2011 at 07:24 AM.



  7. #7
    Forum Contributor
    Join Date
    11-02-2010
    Location
    Philippines
    MS-Off Ver
    Excel 2003
    Posts
    353

    Re: Macro to Filter and Delete Row for Duplicate Entries

    You guys are the best! Thank you so much!
    One more addition if I may, I have one more column (D).. That has Either ABC and EFG.
    Could you also help me include a filter on that to remove and delete the rows that has EFG?
    Hope I'm not asking for too much.

    Many thanks!
    Andrew

  8. #8
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Macro to Filter and Delete Row for Duplicate Entries

    Andrew,

    Something like this?
    Please Login or Register  to view this content.


    Hope that helps,
    ~tigeravatar

  9. #9
    Forum Contributor
    Join Date
    11-02-2010
    Location
    Philippines
    MS-Off Ver
    Excel 2003
    Posts
    353

    Re: Macro to Filter and Delete Row for Duplicate Entries

    @tigeravatar
    Thank you sir, any chance I could out together the first code you gave and the second one?
    Just to clean up the code? I tried merging them but with no luck.
    Basically what I'd like to achieve is:
    - Remove rows with duplicates from Column C
    - Remove rows with Value EFG on column D

    Thanks for your patience sir

  10. #10
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Macro to Filter and Delete Row for Duplicate Entries

    Andrew,

    One way:
    Please Login or Register  to view this content.


    Hope that helps,
    ~tigeravatar

  11. #11
    Forum Contributor
    Join Date
    11-02-2010
    Location
    Philippines
    MS-Off Ver
    Excel 2003
    Posts
    353

    Re: Macro to Filter and Delete Row for Duplicate Entries

    Bingo! Worked perfect sir! Thank you!
    This will save me a lot of time! Thank you! Thank you! ^^

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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