EZ question....how to specify more than one column in the range criteria ???

Skidood

New Member
Joined
Jan 1, 2018
Messages
35
Hi again, hope everyone is well.....how can add a few more columns to the range below?



Sub CommandButton2_Click()
With Range("BX9:BX1009")
.AutoFilter Field:=1, Criteria1:="=0.00"
.SpecialCells(xlCellTypeVisible).EntireRow.Delete
End With
End Sub</pre>
 
Sorry but it didnt work.....it ended up removing all the rows from row 9 down, a process which took a full 2-3 seconds and ended with an error window saying "No cells were found".

I will try that when I come back from the doctors office but can you explain what this line of code from your solution does?

For Cnt = 5 To 78 Step 3
 
Last edited:
Upvote 0

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
It should do exactly what your original code did, but rather than just working on col BX, it should work on Col E,H,K,N etc
 
Upvote 0
Sorry but it didnt work.....it ended up removing all the rows from row 9 down, a process which took a full 2-3 seconds and ended with an error window saying "No cells were found".

Your data in post number has 0.00 and 0.000 in the columns. Autofilter normally works on the appearance in the cell so


Code:
Sub CommandButton2_Click()
   Dim Cnt As Long
   For Cnt = 5 To 78 Step 3
      With Cells(8, Cnt).Resize(1000)
         .AutoFilter Field:=1, Criteria1:="=[B]0.00[/B]"
         .SpecialCells(xlCellTypeVisible).EntireRow.Delete
      End With
   Next Cnt
End Sub


should filter the cells with 0.00 as per the request.
 
Upvote 0

Forum statistics

Threads
1,215,059
Messages
6,122,918
Members
449,094
Latest member
teemeren

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