+ Reply to Thread
Results 1 to 8 of 8

Find duplicates for each parent using VBA in Excel

  1. #1
    Registered User
    Join Date
    03-04-2021
    Location
    India
    MS-Off Ver
    2016
    Posts
    31

    Find duplicates for each parent using VBA in Excel

    Have to columns Column 1 and 2
    For each value in Column 1 , will have multiple values in column 2.
    Need to find our duplicates in Column 2 for each value in column 1.

    Child values can be repeated for different parent values. But under each parent there should not be duplicate child values.
    Need a VBA code to handle this.

    Attached the sample excel, with expected output column.
    Attached Files Attached Files

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

    Re: Find duplicates for each parent using VBA in Excel

    Try
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    03-04-2021
    Location
    India
    MS-Off Ver
    2016
    Posts
    31

    Re: Find duplicates for each parent using VBA in Excel

    Thanks a lot.. for the quick solution.

    For the given example it is working.
    Could you please explain the solution in detail, so that I can apply the same solution on my actual data.
    But, the actual data resides dynamically... in unlimited rows more than 10,000 rows.
    When I tried to apply the same it is actually making the excel slow.

    Could you please provide some performance efficient solution.

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

    Re: Find duplicates for each parent using VBA in Excel

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    03-04-2021
    Location
    India
    MS-Off Ver
    2016
    Posts
    31

    Re: Find duplicates for each parent using VBA in Excel

    Thanks a lot for the quick reply and solution.
    Solution is working fine for the given example.
    Now, I have added another sheet to the excel named "Actual", where it resembles the real data.

    In real data data will start from row 5, so we need start checking from row 5.
    Parent value exists in column D and child value exists in column E.
    We need to check if each parent have any duplicate child.
    And the no of rows are dynamic in number.
    Column position will be constant.
    We need to write Duplicate or not under the column "Error Messages".

    Sorry for bothering you as I am new to VBA, your help is really appreciated.
    Attached Files Attached Files
    Last edited by Saritha123; 04-26-2021 at 12:35 AM.

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

    Re: Find duplicates for each parent using VBA in Excel

    You must remember the given code is tailored to the data set you uploaded, so it MUST have same data layouts and data type when you upload a sample workbook.
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    03-04-2021
    Location
    India
    MS-Off Ver
    2016
    Posts
    31

    Re: Find duplicates for each parent using VBA in Excel

    Thanks a lot... for the solution.
    It really did work well.

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

    Re: Find duplicates for each parent using VBA in Excel

    If that takes care of your original question, select Thread Tools from the menu link above and mark this thread as SOLVED.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] VBA combine two column to find the parent item
    By isasa74 in forum Excel Programming / VBA / Macros
    Replies: 22
    Last Post: 12-06-2016, 03:55 PM
  2. Convert Find Parent Cell Macro to Find Dependent Cell
    By Groovicles in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-06-2016, 07:30 AM
  3. find duplicates in excel
    By annux08 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-09-2015, 06:32 AM
  4. Find Excel Duplicates
    By marsjanik1 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-28-2013, 04:13 PM
  5. Replies: 4
    Last Post: 08-27-2012, 11:08 PM
  6. Excel Can't Find Duplicates???
    By ilikeexcel in forum Excel General
    Replies: 4
    Last Post: 11-11-2011, 04:29 PM
  7. Find parent directory
    By DudeFromAccDept in forum Excel General
    Replies: 4
    Last Post: 11-05-2008, 09:11 AM

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