+ Reply to Thread
Results 1 to 38 of 38

Removing Duplicate Rows based on 2 columns

Hybrid View

  1. #1
    Registered User
    Join Date
    09-21-2011
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    21

    Re: Removing Duplicate Rows based on 2 columns

    I'm running the macro twice on the same dataset, the first time I see duplicates, always 2 rows for the same "Yes" user if they were filtered due to the Yes/No condition in column G, then when I re-run it for a 2nd time those duplicates are removed to display the list perfectly as it should be.

    I can't attach the whole file due to the sensitive information I'm afraid - sorry

    Susie


    EDIT

    What I mean is I have to run the macro twice one after another on the same dataset to see the final result as it should be.
    Last edited by metalpoker; 10-10-2011 at 08:33 AM. Reason: Additional information

  2. #2
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Removing Duplicate Rows based on 2 columns

    Just as a heads-up.

    lastrow = Range("A1").End(xlDown).Row
    will only work correctly if there are no empty spaces or rows in Column A. Its generally better to use:

    lastrow = Range("A" & Rows.Count).End(xlUp).Row
    Since it goes to the last cell in Row A and moves up to the last non-empty row.

    Hope this helps.

    abousetta
    Please consider:

    Thanking those who helped you. Click the star icon in the lower left part of the contributor's post and add Reputation.
    Cleaning up when you're done. Mark your thread [SOLVED] if you received your answer.

+ 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