+ Reply to Thread
Results 1 to 18 of 18

(NEW WORKBOOK) Compare duplicate values data and remove non compliant

  1. #1
    Registered User
    Join Date
    11-05-2011
    Location
    Missouri
    MS-Off Ver
    Office 2010, VBA 7.0
    Posts
    75

    Exclamation (NEW WORKBOOK) Compare duplicate values data and remove non compliant

    Hello and thank you all for your help,

    I have a spreadsheet that contains many columns and rows.

    On this sheet I have in the left most active column a list of Formula names that have more than one record due to the Additives that are associated with the Formula name.(Normally there will be many Formula names some will not have multiple records, I just filtered those out to make it a bit easier to comprehend, I can return them if necessary)

    What I would like the code to do is, find the duplicate Formula names and then compare the data in each of the rows that pertains to that Formula name, and if all the values in the rows are not the same, I need to remove the cell values that are not present in all the rows pertaining to that Formula name.

    and then loop down the sheet and do the same for each record that has duplicate Formula names.

    Thanks again, I attached the spreadsheet.

    This Workbook has been updated, further on in the thread.
    Last edited by lanziniad; 01-17-2012 at 11:48 AM. Reason: Newly Updated WorkBook

  2. #2
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Compare row data based on values in column

    Hi lanziniad
    It would be helpful if you would add a second sheet to your sample file that demonstrates what your results will look like. I could guess but it would be just that.
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  3. #3
    Registered User
    Join Date
    11-05-2011
    Location
    Missouri
    MS-Off Ver
    Office 2010, VBA 7.0
    Posts
    75

    Re: Compare row data based on values in column

    jaslake,

    Thank you for your reply, im sending the updated WB right now, sheet 2 shows the results of what the code should do.
    Last edited by lanziniad; 01-07-2012 at 08:00 PM.

  4. #4
    Forum Expert dangelor's Avatar
    Join Date
    09-06-2011
    Location
    Indiana, USA
    MS-Off Ver
    MS365 V.2406
    Posts
    2,312

    Re: Compare row data based on values in column

    Try on a copy...
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    11-05-2011
    Location
    Missouri
    MS-Off Ver
    Office 2010, VBA 7.0
    Posts
    75

    Re: Compare row data based on values in column

    Thanks,

    Ill try it right now...

  6. #6
    Registered User
    Join Date
    11-05-2011
    Location
    Missouri
    MS-Off Ver
    Office 2010, VBA 7.0
    Posts
    75

    Re: Compare row data based on values in column

    dangelor,

    I tried it, but it deleted way to much, here are the results, Sheet 2 shows what it should have looked like.
    Last edited by lanziniad; 01-17-2012 at 11:50 AM.

  7. #7
    Registered User
    Join Date
    11-05-2011
    Location
    Missouri
    MS-Off Ver
    Office 2010, VBA 7.0
    Posts
    75

    Unhappy Re: Compare multiple rows of data based on values in left most active column

    Is there anyone out there that can help me with this problem?

    Your help is greatly appreciated...

  8. #8
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Compare multiple rows of data based on values in left most active column

    Hi lanziniad
    I, for one, can't make any sense of your logic. You have two items for Formula 30M1 (in Column C); Column K for these two items are different (3152 and 30M1) yet you're keeping 30M1 and discarding 3152. This doesn't fly with this
    I need to remove the cell values that are not present in all the rows pertaining to that Formula name.
    Same is true for Formula 3492 except that two of the items are the same and one is different yet, you're keeping two and discarding one. Columns L & M are even more confusing. I believe further explanation is required.

  9. #9
    Registered User
    Join Date
    11-05-2011
    Location
    Missouri
    MS-Off Ver
    Office 2010, VBA 7.0
    Posts
    75

    Re: Compare multiple rows of data based on values in left most active column

    jaslake,

    sorry to make this confusing, ill do my best to explain.

    Column C holds the Start or (Main) Formula names, then each formula name takes one or more Additives which are shown in Column D. Columns E to Whatever hold the formulas that are compatible with that paticular Formulas Additives, and if each corresponding row that pertains to the StartFormula in question does contain even one follow Formula that is not in any of that Startformulas rows, it must be deleted. So in essence the rows that correspond to the Start Formula must contain the exact same follow formula names, and if there is one or more that do not show up in each of its rows it must be deleted.

    This spreadsheet is generated from a access query.

    Hope this helps.

    Thank you for your response...

  10. #10
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Compare multiple rows of data based on values in left most active column

    Hi lanziniad
    I've a massive head cold, a touch of the Flu, a head and ears that ache and a throat that's raw from hacking the last three days and can't get into see the Doc until tomorrow. So, I have no wish to try to think through your logic. Please see attached and explain what you're looking at and how your decisions are made. Of course, you could wait until I feel better...I may be willing to pay more attention to it then...but...probably not. You've not explained it well (in my opinion).
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    11-05-2011
    Location
    Missouri
    MS-Off Ver
    Office 2010, VBA 7.0
    Posts
    75

    Re: Compare multiple rows of data based on values in left most active column

    ok, sorry you feel bad.

    Ive done my best to explain it.

    thanks for your help...

  12. #12
    Registered User
    Join Date
    11-05-2011
    Location
    Missouri
    MS-Off Ver
    Office 2010, VBA 7.0
    Posts
    75

    Re: Compare multiple rows of data based on values in left most active column

    jaslake,

    Here is my best explaination that I can think of, and it address the questions that you asked in sheet 2.
    Last edited by lanziniad; 01-17-2012 at 11:52 AM.

  13. #13
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Compare multiple rows of data based on values in left most active column

    Hi lanziniad
    I can think of an approach to do as you describe. How many records are we talking about, including these?
    there will be many Formula names some will not have multiple records
    How many Formula names WILL have multiple records?

    The reason I ask is that the approach I'm considering will involve A LOT of looping. Of course, if this is a one time shot then it may not matter how long it takes (within reason).

  14. #14
    Registered User
    Join Date
    11-05-2011
    Location
    Missouri
    MS-Off Ver
    Office 2010, VBA 7.0
    Posts
    75

    Re: Compare multiple rows of data based on values in left most active column

    jaslake,

    thanks for your reply. The amount will vary and it will used everyday.

  15. #15
    Registered User
    Join Date
    11-05-2011
    Location
    Missouri
    MS-Off Ver
    Office 2010, VBA 7.0
    Posts
    75

    Re: Compare multiple rows of data based on values in left most active column

    Thanks for all your help.

  16. #16
    Registered User
    Join Date
    11-05-2011
    Location
    Missouri
    MS-Off Ver
    Office 2010, VBA 7.0
    Posts
    75

    Re: Compare multiple rows of data based on values in left most active column

    bump me to the front

  17. #17
    Registered User
    Join Date
    11-05-2011
    Location
    Missouri
    MS-Off Ver
    Office 2010, VBA 7.0
    Posts
    75

    Exclamation Re: (NEWLY UPDATED) Find Dups and Compare Values

    Ok I have reconfigured my spreadsheet, hopefully this will be less confusing.
    What I need is to find Duplicate Values on Row 2 starting at Column C and then for each set of Duplicates compare their columns and remove any values that are not all their columns.
    Last edited by lanziniad; 01-17-2012 at 11:39 AM.

  18. #18
    Forum Expert dangelor's Avatar
    Join Date
    09-06-2011
    Location
    Indiana, USA
    MS-Off Ver
    MS365 V.2406
    Posts
    2,312

    Re: (NEWLY UPDATED) Find Dups and Compare Values

    Try this...
    Please Login or Register  to view this content.

+ 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