+ Reply to Thread
Results 1 to 8 of 8

Code or Formula to delete rows based on multiple criteria

  1. #1
    Registered User
    Join Date
    01-04-2020
    Location
    America
    MS-Off Ver
    Excel 2010
    Posts
    36

    Code or Formula to delete rows based on multiple criteria

    Hello all!

    I am looking for a code or formula to delete the entire row if it meets the following conditions... I would like the entire row deleted if "Column B" is the first instance (by column A) and it correlates to an "N" in "Column C". I would also like every row that contains the same number in "Column A" as the one that was deleted to be deleted. I know that this is confusing, so I will explain my example sheet below...

    I would want everything that is highlighted in the example to have the whole row deleted.

    1234 should be deleted because the first instance of it has an "N" in Column C.

    1245 should be deleted because the first instance of it has an "N" in Column C.

    1356 should NOT be deleted because the first instance of it does not have an "N" in Column C.

    1589 and 1679 should be deleted because the first instance of them have an "N" in Column C.

    Note: Column B does not have to be "1" to be deleted, but rather the first number of the set.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Code or Formula to delete rows based on multiple criteria

    See next code
    Please Login or Register  to view this content.
    - Battle without fear gives no glory - Just try

  3. #3
    Registered User
    Join Date
    01-04-2020
    Location
    America
    MS-Off Ver
    Excel 2010
    Posts
    36

    Re: Code or Formula to delete rows based on multiple criteria

    Thank you! I have one question... What if Column B and C were Column AD and AE, respectively?

  4. #4
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Code or Formula to delete rows based on multiple criteria

    See next code and adjust Const value to your next need.
    Note column "B" is not used.
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    01-04-2020
    Location
    America
    MS-Off Ver
    Excel 2010
    Posts
    36
    Quote Originally Posted by PCI View Post
    See next code and adjust Const value to your next need.
    Note column "B" is not used.
    Please Login or Register  to view this content.
    Thank you as always!

  6. #6
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Code or Formula to delete rows based on multiple criteria

    You're welcome

  7. #7
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,446

    Re: Code or Formula to delete rows based on multiple criteria

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however it has been brought to our attention that the same query has been posted on one or more other forums and you have not provided the required cross-post link(s) here.

    Please see Forum Rule #3 about cross-posting and adjust accordingly. Read this to understand why we (and other sites like us) consider this to be important.

    (Note: this requirement is not optional. No help to be offered until the link is provided.)

  8. #8
    Registered User
    Join Date
    01-04-2020
    Location
    America
    MS-Off Ver
    Excel 2010
    Posts
    36

    Re: Code or Formula to delete rows based on multiple criteria

    https://www.mrexcel.com/board/thread...2#post-5403552

    Above is the link in another publication. I'm sorry!

+ 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] VB Code to delete certain rows based on criteria
    By rizmomin in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-25-2019, 05:12 PM
  2. VBA to delete rows based on multiple criteria
    By jamesmullens in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-28-2017, 06:33 AM
  3. Replies: 4
    Last Post: 05-18-2016, 03:48 AM
  4. Delete Multiple Rows based on Criteria
    By athyeh in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 06-20-2013, 03:13 PM
  5. Delete rows based on multiple criteria
    By ohkking in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 04-18-2011, 11:30 AM
  6. Delete rows based on multiple criteria
    By couger77 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-17-2007, 03:29 PM

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