+ Reply to Thread
Results 1 to 8 of 8

Remove Duplicates in a Dynamic Range using Excel 2007

  1. #1
    Registered User
    Join Date
    06-02-2009
    Location
    Arlington, VA
    MS-Off Ver
    Excel 2007
    Posts
    80

    Remove Duplicates in a Dynamic Range using Excel 2007

    I am using the follwoing code which works as it is supposed to except that it does not remove the duplicate entries, almost as though the code skips that step. How can I fix this?

    Please Login or Register  to view this content.
    Last edited by nsorden; 07-24-2009 at 01:08 PM.

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,434

    Re: Remove Duplicates in a Dynamic Range using Excel 2007

    Try adding explicit references to your Cell references.

    Please Login or Register  to view this content.
    And all the other places in your code where you use CELL without a preceeding dot reference
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    06-02-2009
    Location
    Arlington, VA
    MS-Off Ver
    Excel 2007
    Posts
    80

    Re: Remove Duplicates in a Dynamic Range using Excel 2007

    I tried it but it is still failing to remove the duplicates. I have tried switching the order of the sort and duplicate removal, but it does not seem to work.

  4. #4
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,434

    Re: Remove Duplicates in a Dynamic Range using Excel 2007

    You need to post example workbook to illustrate your problem

  5. #5
    Registered User
    Join Date
    06-02-2009
    Location
    Arlington, VA
    MS-Off Ver
    Excel 2007
    Posts
    80

    Re: Remove Duplicates in a Dynamic Range using Excel 2007

    Sample workbook is attached.
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    06-02-2009
    Location
    Arlington, VA
    MS-Off Ver
    Excel 2007
    Posts
    80

    Re: Remove Duplicates in a Dynamic Range using Excel 2007

    I think the problem is actually in the line:
    Please Login or Register  to view this content.
    It is not counting correctly and therefore is not producing any duplicates to be removed.

  7. #7
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,434

    Re: Remove Duplicates in a Dynamic Range using Excel 2007

    These changes at least get the macro to run.

    Please Login or Register  to view this content.
    Is your problem still there, as I don't really know what I'm looking for in your data set.

  8. #8
    Registered User
    Join Date
    06-02-2009
    Location
    Arlington, VA
    MS-Off Ver
    Excel 2007
    Posts
    80

    Re: Remove Duplicates in a Dynamic Range using Excel 2007

    Yes the Countif and Right functions were working at the same time-producing no duplicates. I made the following change:
    Please Login or Register  to view this content.
    Thanks for your time.

+ 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