Results 1 to 3 of 3

Thread: VBA Delete Rows if 2 conditions are met
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    Board Regular
    Join Date
    May 2011
    Posts
    422
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question VBA Delete Rows if 2 conditions are met

    Hello I need help with a bit of VBA code.

    I need the code to look at Column AI.
    Column AI can have a value of 0-7.
    If a Row in Column AI has a value of "0" check column Notes, If it is empty delete that Row.

    In the example below rows 4 & 5 would be deleted as they have an AI value = 0 and no Notes.


    1 Date Team AI Match Notes
    2 9/1/2019 Team 04 0 yes checked
    3 9/5/2019 Team 01 4 yes
    4
    9/7/2019
    Team 05
    0
    no
    5
    9/12/2019
    Team 03
    0
    yes
    6 9/15/2019 Team 07 2 yes
    7 9/22/2019 Team 11 0 yes checked
    8 9/30/2019 Team 09 1 no


    Thank you for any and all help!
    Running Excel 2010

  2. #2
    MrExcel MVP
    Moderator
    Fluff's Avatar
    Join Date
    Jun 2014
    Location
    Chippenham
    Posts
    29,229
    Post Thanks / Like
    Mentioned
    483 Post(s)
    Tagged
    49 Thread(s)

    Default Re: VBA Delete Rows if 2 conditions are met

    You can use autofilter for that, just filter the AI column for 0 and the notes column for blanks & then delete the rows.
    If you want the code, then use the recorder whilst you do it manually.
    - Posting Data try one of these tools
    - Posting guidelines, forum rules and terms of use
    - Read the FAQs

    Running Office 365 on Win 10

  3. #3
    Board Regular
    Join Date
    May 2011
    Posts
    422
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: VBA Delete Rows if 2 conditions are met

    Quote Originally Posted by Fluff View Post
    You can use autofilter for that, just filter the AI column for 0 and the notes column for blanks & then delete the rows.
    If you want the code, then use the recorder whilst you do it manually.
    Thank you for your reply, unfortunately it is for a report I am building that others will be running and 2 additional conditions were just added too.
    I will repost with additional conditions.

    Thank you again.
    Running Excel 2010

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •