VBA Delete Rows if 2 conditions are met

LNG2013

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

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
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.
 
Upvote 0
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.
 
Upvote 0

Forum statistics

Threads
1,214,643
Messages
6,120,702
Members
448,980
Latest member
CarlosWin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top