VBA Delete Rows if 2 conditions are met

LNG2013

Active Member
Joined
May 23, 2011
Messages
422
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

<tbody>
</tbody>


Thank you for any and all help!
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
30,246
Office Version
365
Platform
Windows
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.
 

LNG2013

Active Member
Joined
May 23, 2011
Messages
422
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.
 

Forum statistics

Threads
1,077,822
Messages
5,336,564
Members
399,088
Latest member
Swindlestikz

Some videos you may like

This Week's Hot Topics

Top