VBA to Filter / Unfilter

Dazzybeeguy

Board Regular
Joined
Jan 6, 2022
Messages
111
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
I want to assign a Macro that unfilters to remove any blanks or values of Zero. When I record a Macro for this it works fine but as soon as another value is entered it does not work, it only filters it to all the options that were there when the macro was recorded. So as per example below if that column then showed Name7 it would not be in the filtered list.

ActiveSheet.Range("$A$3:$DL$1567").AutoFilter Field:=24, Criteria1:=Array( _
"1", "a", "Name1", "Name2", "Name3", "Name4", "Name5", "Name6", "v"), Operator _
:=xlFilterValues
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
If you want to hide blanks & zeros, try
Excel Formula:
ActiveSheet.Range("$A$3:$DL$1567").AutoFilter 24, "<>0", xlAnd, "<>"
 
Upvote 0
Solution
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,223,238
Messages
6,170,939
Members
452,368
Latest member
jayp2104

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