Can Vba autofilter out that criteria?

holycome99

New Member
Joined
Nov 16, 2020
Messages
15
Office Version
  1. 365
Platform
  1. Windows
My table have many kind of food, almost each have different name
1607158101980.png

like this.
But what i wanted to do is that to filter out that "-"
I tried to run macro that use autofilter to include all the name except "-"
However, once i update the table (More and more different kind of food),
the new food will be kicked out also!
ActiveSheet.ListObjects("Diet").Range.AutoFilter Field:=4, Criteria1:=Array _
("Banana", "Curry Rice", "Hot Dog", "Noodles"), Operator:=xlFilterValues
Probably is that the macro won't be up-to date when i update new food to table
How can i only kicked "-" out but without kicking other new food name?
Thank u much!
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
Cant you just use "<>-" as a criteria?
 
Upvote 0
Solution

Forum statistics

Threads
1,214,606
Messages
6,120,485
Members
448,967
Latest member
visheshkotha

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