Results 1 to 5 of 5

Count the number of duplicates in a sheet, report the duplicate cells to a new sheet.

Threaded View

  1. #1
    Registered User
    Join Date
    09-13-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    3

    Count the number of duplicates in a sheet, report the duplicate cells to a new sheet.

    hey everyone , I have been trying to write a macro which will check for the duplicate rows in a sheet for a given cell conditions and later copy the duplicates to a new sheet and report how many times that row/stirng is repeated.

    I wrote a macro and it doesn't work saying "Run Time Error"- Application undefined or object defined error.

    Attached is the excel file showing the index sheet (where the macro has to do the search of duplicates) and the sample sheet (shows the result on what the macro should report). I already tried to write a macro and it shows some errors. Please look at the excel file for better understanding.

    For ex:
    In the "index sheet"(in the excel file) i have the following columns:

    the stack-up column is has 2T/3T, so the macro should loop through the row which has the cell value as 2T(skip the row if it is 3T) and read Material1 (mat1) , Material 2(mat2) under the respective columns in that row and loop through the remaining rows and check if there are any duplicates for the same material1, material 2 combination irrespective of thickness values & job nos. and report either it a unique/duplicate row(no.of duplicates) in a new sheet with that material combination.

    JOB NO STACK-UP MAT 1 THICK 1 MATERIAL 2 THICKNESS 2 MATERIAL 3 THICKNESS 3
    mm mm mm

    C338-2600-6A 2T DP600 0.8 DP600 1 N/A N/A
    C338-2600-7A 2T HSLA300 1.9 DP600 0.8 N/A N/A
    C338-2600-8A 2T HSLA300 1.8 DP600 1.3 N/A N/A
    C338-2600-8B 2T HSLA300 1.8 DP600 1.3 N/A N/A
    C338-2600-10B 3T MILD STEEL 3 0.6 MILD STEEL 3 0.75 HSLA300 1.8
    10007-3 3T DP600 2 DP600 2 DP600 2
    10007-4-PA 2T HSLA300 2.5 HSLA300 2.9 N/A N/A
    10007-4-PB 2T HSLA300 2.9 HSLA300 2.5 N/A N/A
    10007-5-PA 3T LOW CARBON MILD STEEL 1.1 HSLA300 2.5 HSLA300 2.9
    3732r2 2T HSLA550 1.3 USIBOR 1.4 N/A N/A
    3732r4-PA 2T USIBOR 1.4 HSLA350 2 N/A N/A
    3732r4-PB 2T HSLA350 2 USIBOR 1.4 N/A N/A


    Below shows how the macro should report the result in a new sheet called material.

    MATERIAL 1 MATERIAL 2 No.of Records
    DP600 DP600 1
    HSLA300 DP600 3
    HSLA300 HSLA300 2
    HSLA350 USIBOR 1
    USIBOR HSLA350 1
    HSLA550 USIBOR 1

    Attached is the excel file showing the index sheet (where the macro has to do the search of duplicates) and the sample sheet (shows the result on what the macro should report). I already tried to write a macro and it shows some errors.

    Thanks for your help in advance, either editing the macro i have written and a new code is fine.
    Attached Files Attached Files

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