Auto filters and locked protected sheet

wmtsub

Active Member
Joined
Jun 20, 2018
Messages
322
Is ther some way to protect a worsheet so ppl can not write/delete data but still can use the colum filters to sort and search?
 
Here's an example I use for Protecting a sheet with VBA:
Code:
[COLOR=#333333]ActiveSheet.Protect [/COLOR][B][COLOR=red]Password:="YourPassword",[/COLOR][/B][COLOR=#333333] DrawingObjects:=True, Contents:=True, Scenarios:=True _
[/COLOR][COLOR=#333333], AllowSorting:=True, AllowFiltering:=True, AllowUsingPivotTables:=True[/COLOR]

Then if you want to unprotect via VBA use:
Code:
[COLOR=#333333]ActiveSheet.UnProtect [/COLOR][B][COLOR=red]Password:="YourPassword"[/COLOR][/B]
 
Upvote 0

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
Thank you, yes, got that far last night.
Stuck right now on getting it to allow me to sort. I can search but not use the sort function. The worksheet is a Table, would that have any effect?
I replaced my code with yours and it worked the same, wont let me sort.
 
Upvote 0
Bump.... I can nto ge the sort funtion to work when the sheet is protected. Is it because it is a table?
If so is ther some way to work around that?
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,329
Members
452,635
Latest member
laura12345

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