+ Reply to Thread
Results 1 to 8 of 8

Find any duplicates, and eliminate the data with lower level of priority.

  1. #1
    Forum Contributor
    Join Date
    07-04-2012
    Location
    malaysia
    MS-Off Ver
    Excel 2007
    Posts
    105

    Find any duplicates, and eliminate the data with lower level of priority.

    Hi guys.

    i got one problem .I would run this workbook on daily routine. So i hope it can be in form of VBA code so i can make it even simple to manage. I hope u guys can help me here.


    I want to find duplicates Order in Column A. Only if it find any,then it will refer to column D. So here is the critical part. Based on column D value , the code will keep the entire row with high level of priority, and eliminate the rest of them.

    So here is the level of priority in column D , sorted from highest to lowest.
    1) QC-NDE
    2) XTPAINT
    3) QC

    But if the level of priority in Column D is also same, then it will refer to OpAC in column B. The code will keep the entire row with LOWER value and eliminate the rest.


    So at last, there will be only one kind of Order with the highest level of priority and lowest OpAC..See my attachment. You may consider you have solved the code when you can eliminate the rows with red highlight.


    Thanks in advance .Really appreciate your help.
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    08-08-2012
    Location
    UAE
    MS-Off Ver
    Excel 2007
    Posts
    43

    Re: Find any duplicates, and eliminate the data with lower level of priority.

    Do you care about the order of the data? Is it okay if it is sorted through the VBA code?

  3. #3
    Registered User
    Join Date
    08-08-2012
    Location
    UAE
    MS-Off Ver
    Excel 2007
    Posts
    43

    Re: Find any duplicates, and eliminate the data with lower level of priority.

    I have written the code and the sheet at the end gives the output of the code. Have not defined sheet name within the code so make sure you are on the main sheet and then run the code. Secondly, I have defined the range within the code starting row 11 so make sure that the format does not change.

    Feel free to reach out in case you need anything further on it.
    Attached Files Attached Files

  4. #4
    Forum Contributor
    Join Date
    07-04-2012
    Location
    malaysia
    MS-Off Ver
    Excel 2007
    Posts
    105

    Re: Find any duplicates, and eliminate the data with lower level of priority.

    Dear Ashali,

    I think ur code just fine, it define the level of priority correctly with the followed action.

    Except for the last part. when it find the same Order and same Workcounter, i need the code to delete the one that has the more higher OPAC number.


    And in case of same Order, same Workcounter and same Opac, ur code just remove all of them . What i want is the code to keep only the first coming..

    Thanks for helping anyway. I hope u can assist me through this.
    Last edited by pyol17; 09-09-2012 at 10:25 PM.

  5. #5
    Registered User
    Join Date
    08-08-2012
    Location
    UAE
    MS-Off Ver
    Excel 2007
    Posts
    43

    Re: Find any duplicates, and eliminate the data with lower level of priority.

    Hope the enclosed macro serves the purpose.

    If you are happy with the solution, could you please mark this thread as solved and save the moderators some effort.
    Attached Files Attached Files

  6. #6
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: Find any duplicates, and eliminate the data with lower level of priority.

    See if this works.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    08-08-2012
    Location
    UAE
    MS-Off Ver
    Excel 2007
    Posts
    43

    Re: Find any duplicates, and eliminate the data with lower level of priority.

    Didnt realize the solution was as simple and straight forward as the one provided by Jindon! Brilliant!

  8. #8
    Forum Contributor
    Join Date
    07-04-2012
    Location
    malaysia
    MS-Off Ver
    Excel 2007
    Posts
    105

    Re: Find any duplicates, and eliminate the data with lower level of priority.

    Thanks both of u nayway.. i will mark this as solved then.

+ 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