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,532
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,078,447
Messages
5,340,344
Members
399,370
Latest member
salamon

Some videos you may like

This Week's Hot Topics

  • Problem with Radio Button's format control
    I am creating an employee evaluation template (a sample is below) Column A is the category Column B, C D, E and F will be ratings (unacceptable...
  • Last Display on userform to a Listbox
    [CODE=vba] lstdisplay.ColumnCount = 15 lstdisplay.RowSource = "A1:O600000" [/CODE] So when i do this it Displays everything on the sheet i am...
  • Rename and move files to a new location
    Dear all, I have an excel file with the following information. The actual file name is at column A but i want to rename it using the following...
  • Help with True/False Formula
    Hello! Am stumped how to fix this formula, in which my result returns 'True', but it should return False. =IF(AG2=True...
  • Clear extra characters from a provided range of cells
    Dear All, I have following code which gives me desired output to remove extra characters from a provided range. But it takes too much time when...
  • Help with Current and highest streaks
    Hi there, I've just joined the forum and this is my first post. I've already spent quite a bit of time searching the net and this forum for a...
Top