This should be easy (Filtering)

rplim2016

Board Regular
Joined
Jun 28, 2016
Messages
76
Hello Mr. Excel Users!

Scenario

Excel sheet1 is protected with pw
Row 2:2 is in autofilter before being protected

below code isn't working:
Code:
    ActiveSheet.Range("$A$2:$L$3000").AutoFilter Field:=12, Criteria1:="FALSE"

Can someone help me please. :)
 
Last edited:

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
When you protected the sheet did you select the check box that says "Use AutoFilter"?
 
Upvote 0
When you protected the sheet did you select the check box that says "Use AutoFilter"?


Thanks for answering Fluff, yes. It was checked. Still, error msgbox pop up saying that I should unprotect the sheet.

I tried to out of unchecked out of curiosity but excel wouldn't allow me to use the manual filter, while if it marked checked I can manually filter, but in VBA it doesn't work.
 
Last edited:
Upvote 0
It seems that you can't autofilter a protected sheet with VBA.
You will need to unprotect the sheet prior to filtering & then re-protect the sheet afterwards.
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,240
Members
452,621
Latest member
Laura_PinksBTHFT

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