VBA to set Autofilter criteria to SelectALL on multiple columns

Javi

Active Member
Joined
May 26, 2011
Messages
440
Hi All,

I'm trying to use VBA to set the criteria on specific columns (s) to select all. There are number of columns that will have the criteria manually set that I do not want to modify.

When I use the below code it will remove all the criteria but it will not set it to "select All" leave all the selections uncheck completely.

Any help would be greatly appreciated thanks for reviewing.

Code:
Sub Reset_filters3()

ActiveSheet.Unprotect

ActiveSheet.Range("A4").AutoFilter Field:=1, Criteria1:="(Selectall)"
ActiveSheet.Range("B4").AutoFilter Field:=1, Criteria1:="(Selectall)"
ActiveSheet.Range("E4").AutoFilter Field:=1, Criteria1:="(Selectall)"
'ActiveSheet.Range("A4").AutoFilter Field:=1, Criteria1:="Selectall"
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True _
        , AllowSorting:=True, AllowFiltering:=True, AllowUsingPivotTables:=True
End Sub
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
Update:

This code works but I can only get it to select a value in the list ... What I need is it to select all...


suggestions please!!!

Code:
ActiveSheet.Range("A:AC").AutoFilter Field:=5, Criteria1:="0.00"
 
Upvote 0

Forum statistics

Threads
1,214,589
Messages
6,120,415
Members
448,960
Latest member
AKSMITH

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