Allow for Auto Filter on Password Protected Workbook with multiple worksheets

Vero

New Member
Joined
Jul 15, 2011
Messages
5
Hi,

Excel version used: MSOffice ProPlus
Version 1705

I have a workbook with a couple of buttons allowing us to lock and unlock the workbook using a password.
Because we have many values, we need to enable auto filter on one cell range but, I have scratching my head about how to do this.

For some weird reason, auto filter appears to work for the last worksheet in the book.
I add " Application.ShowDevTools = True" to the existing VBA code and also tried allowing auto filter from each sheet but to no avail.

Can someone please help?

Vero

here is the code


Sub UnProtect()
'
' UnProtect Macro
' Takes off protections
'


Dim password As Variant
password = Application.InputBox("Enter Password", "Password Protected")


Select Case password
Case Is = False
'do nothing
Case Is = "PASSWORD"
Application.ShowDevTools = True
Sheet3.UnProtect password:="KareoSoftware"
Sheet4.UnProtect password:="KareoSoftware"
Sheet5.UnProtect password:="KareoSoftware"
Sheet6.UnProtect password:="KareoSoftware"
Sheet7.UnProtect password:="KareoSoftware"
Sheet8.UnProtect password:="KareoSoftware"
Sheet9.UnProtect password:="KareoSoftware"
Sheet13.UnProtect password:="KareoSoftware"
Sheet15.UnProtect password:="KareoSoftware"
Sheet16.UnProtect password:="KareoSoftware"
Sheet17.UnProtect password:="KareoSoftware"
Case Else
MsgBox "Incorrect Password"
End Select
'

ActiveWorkbook.Save
End Sub
Sub Protect()
'
' Protect Macro
'
Application.ShowDevTools = False
AllowFiltering = True
Sheet3.Protect password:="KareoSoftware"
Sheet4.Protect password:="KareoSoftware"
Sheet5.Protect password:="KareoSoftware"
Sheet6.Protect password:="KareoSoftware"
Sheet7.Protect password:="KareoSoftware"
Sheet8.Protect password:="KareoSoftware"
Sheet9.Protect password:="KareoSoftware"
Sheet13.Protect password:="KareoSoftware"
Sheet15.Protect password:="KareoSoftware"
Sheet16.Protect password:="KareoSoftware"
Sheet17.Protect password:="KareoSoftware"
'
End Sub
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.

Forum statistics

Threads
1,223,907
Messages
6,175,301
Members
452,633
Latest member
DougMo

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