+ Reply to Thread
Results 1 to 3 of 3

Objective: delete rows based on multiple criteria matching

  1. #1
    Registered User
    Join Date
    11-14-2013
    Location
    New York
    MS-Off Ver
    Excel 2010
    Posts
    96

    Objective: delete rows based on multiple criteria matching

    I am trying to delete entire rows if cell data in columns G & K on sheet1 BOTH match the data in column G & K on sheet2. I think whats confusing me is a loop inside a loop (my logic - looping thru the rows of sheet1 with the rows of sheet 2?).

    Thank you in advance for any thought - im hoping the solution is that its easier than my train of thought.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,518

    Re: Objective: delete rows based on multiple criteria matching

    The solution should be relatively easy. 1) use a row index to loop UP through the rows from the bottom to the top. If you start at the top, you can leap-frog records and 2) use Application.WorksheetFunction.CountIfs() to determine if the current entries are present in the second sheet. If the result is greater than zero, there is at least one matching entry.

    Post a sample workbook with some typical data if you want a tested solution.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    11-14-2013
    Location
    New York
    MS-Off Ver
    Excel 2010
    Posts
    96

    Re: Objective: delete rows based on multiple criteria matching

    Sure thing, and i see the logic behind your explanation - don't think i ever tried that.
    Attached is a mock WB. The highlighted cell would represent the matching data, therefore need to be removed.
    Thank you again
    Attached Files Attached Files

+ 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. Combine multiple rows in a specific column based on matching criteria? VBA solution?
    By hopegriffin in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-06-2015, 07:11 PM
  2. Macro to delete rows based on two different criteria matching
    By Cpower17 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-25-2014, 05:43 PM
  3. Delete Multiple Rows based on Criteria
    By athyeh in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 06-20-2013, 03:13 PM
  4. [SOLVED] Delete Rows based on Multiple Name Criteria
    By Graham Taylor in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-14-2012, 09:11 AM
  5. [SOLVED] Mark or Delete Rows based on Matching Multiple Criteria in another worksheet
    By clearbluez in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-11-2012, 02:38 PM
  6. Delete rows based on multiple criteria
    By ohkking in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 04-18-2011, 11:30 AM
  7. Delete rows based on multiple criteria
    By couger77 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-17-2007, 03:29 PM

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