Hi Friends,
I have a workbook (please, see the attached file sample) with 2 worksheets: "S1" and "S2". Both worksheets have a few rows with 500 cells filled randomly with numbers (1 to 500, no duplicates, columns "B" to "SG"), and column "A" is filled with a number of identification.
Although each row has 500 cells (columns "B" to "SG"), I need to split the row into 50 groups of 10 cells (columns "B" to "K", columns "L" to "U", and so forth).
Then, I need to compare each group of 10 cells (50 groups in each row) in worksheets "S2" against each one of the 50 groups with 10 cells in each row in worksheets "S1", and to delete the entire row in worksheet "S2" that has a group of 10 cells with more than 1 common elent when compared to any of the 50 groups in each row in worksheet "S1".
The final goal is to delete rows in worksheet "S2" that have a group of 10 cells with more than 1 element in common with any of the groups in the rows in worksheet "S1".
I have written a basic macro with so many loops, that is takes a long time to compare the groups of a single row.
So, I would like to ask your help to write an advanced code, that could speed up the comparison of each group in worksheet "S2" to each group in worksheet "S1" and delete the entire row in worksheet "S2" if there is a group with more than 1 element in common.
The sample file shows these two worksheets. The rows with the numbers "102", "104" and "107" in column "A" should be deleted after macro execution, The sample file is similar to the actual file, exept that the actual file has thousands of rows in each worksheet.
Any help will be appreciated.
Bookmarks