Delete entire row base on two conditions

Panoos64

Well-known Member
Joined
Mar 1, 2014
Messages
822
Hi all, i would like to prepare a VBA code so that to run through col. "F" and where the text is like "Opening Balance" and in col. "J" is zero number "0" should delete entire row. Please see below an extract of my data row "28" which i wanted to delete. Thank you all in advance





ABCDE FGHIJ
28Opening Balance PASTRIES & DELICATESSEN 0

<colgroup><col style="mso-width-source:userset;mso-width-alt:739;width:16pt" width="21"> <col style="mso-width-source:userset;mso-width-alt:796; width:17pt" width="22" span="5"> <col style="mso-width-source:userset;mso-width-alt:13226;width:279pt" width="372"> <col style="mso-width-source:userset;mso-width-alt:1024; width:22pt" width="29" span="4"> </colgroup><tbody>
</tbody>
 

Some videos you may like

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
46,335
Office Version
  1. 365
Platform
  1. Windows
How about
Code:
Sub Panoos64()
   With ActiveSheet
      If .AutoFilterMode Then .AutoFilterMode = False
      .Range("A1:J1").AutoFilter 6, "opening balance*"
      .Range("A1:J1").AutoFilter 10, "0"
      .AutoFilter.Range.Offset(1).EntireRow.Delete
      .AutoFilterMode = False
   End With
End Sub
 
Last edited:

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
46,335
Office Version
  1. 365
Platform
  1. Windows
You're welcome & thanks for the feedback
 

Watch MrExcel Video

Forum statistics

Threads
1,109,004
Messages
5,526,223
Members
409,688
Latest member
Mc Junior

This Week's Hot Topics

Top