+ Reply to Thread
Results 1 to 1 of 1

Macro - Remove Duplicates and Lower Values

  1. #1
    Registered User
    Join Date
    10-12-2010
    Location
    London, UK
    MS-Off Ver
    Excel 2007
    Posts
    1

    Macro - Remove Duplicates and Lower Values

    Hi,

    Wondering if any one can help. I have been searching online for quite sometime but can't seem to find a solution to what I'm looking for.

    Apologies for the long description but I hope it will reduce the amount of Q&A.

    I have written a macro to get me to a point with my raw data whereby I have identified the number of instances that it appears using a concatentation of 3 columns and have seperated these from the unique instances.

    What I would like to do with the data now, and where I'm having a problem, is to remove duplicates and lower values based on additional columns.

    Column A represents columns B, C & D concatenated and by which I have determined the duplicates thus far. What I now need to do is remove duplicates based on column A and on columns E and F and also remove rows whereby column A is duplicated but the value in column E is lower. To add to the complexity, for a particular duplicate in column A, if one of the values in column E is text eg Other or NA, then I need to leave and NOT remove all instances of column A.

    To Summarise:
    1. Remove Duplicates whereby Columns A, E and F match and column E does not contain text
    2. Remove Rows whereby Column A and F match and where column E is not the highest value and that none of the values in E for duplicates of A are text
    3. All rows removed to be copied to a worksheet called "Removed"

    I have attached an example spreadsheet, however the data I work with will vary in length, usually 40k-150k lines, and usually have additional columns although the additional columns would be irrelevant.

    In this small example based on the rules above rows 5, 11, 17, 20, 23, 24 & 25 would be moved to the "Removed" worksheet and the others would remain.

    Any help would be grealty appreciated because I have been trying to do this for over a week and being fairly new to VBA it is doing my head in.

    Thank you in advance

    Rich.

    PS Using excel 2007
    Attached Files Attached Files

+ 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