Results 1 to 7 of 7

How to compare arrays and delete entire row when condition is met

Threaded View

JOAO12 How to compare arrays and... 10-01-2020, 08:49 PM
jindon Re: How to compare arrays and... 10-02-2020, 08:56 AM
JOAO12 Re: How to compare arrays and... 10-03-2020, 11:45 AM
jindon Re: How to compare arrays and... 10-04-2020, 12:35 AM
JOAO12 Re: How to compare arrays and... 10-04-2020, 09:54 AM
jindon Re: How to compare arrays and... 10-05-2020, 02:32 AM
JOAO12 Re: How to compare arrays and... 10-05-2020, 03:55 PM
  1. #1
    Registered User
    Join Date
    01-06-2013
    Location
    New York, EUA
    MS-Off Ver
    Excel 2013
    Posts
    77

    How to compare arrays and delete entire row when condition is met

    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.
    Attached Files Attached Files
    Last edited by JOAO12; 10-01-2020 at 08:53 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] delete entire row with condition
    By dumdumbum in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-06-2020, 07:04 AM
  2. [SOLVED] If condition match then delete entire row by vba else do nothing
    By MoldyBread in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-10-2020, 10:26 AM
  3. delete empty entire row with condition
    By ash3angel in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 06-29-2015, 08:29 AM
  4. [SOLVED] VBA to delete entire row based on condition met
    By shiva_reshs in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-17-2014, 05:48 PM
  5. [SOLVED] Macro to delete entire row on a condition
    By kgonzalbo in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-30-2011, 12:39 AM
  6. Delete entire row on condition
    By bouitac in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-06-2009, 04:58 PM
  7. Can I delete an entire row if condition is not met?
    By Christine in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 05-04-2006, 04:50 AM

Tags for this Thread

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