PritishS
Board Regular
- Joined
- Dec 29, 2015
- Messages
- 119
- Office Version
- 2007
- Platform
- Windows
Hi,
My requirement: I'm using MS-Excel 2007. I have a protected sheet with 10 columns where I applied filter. during protecting my sheet I have selected the option 'AutoFilter" checked. But the problem I faced, if I filter data from all 10 columns, I cant reset all filters in a single click. I have to clear filter one by one.
To resolve this I have created a button and macro to clear/ reset filter in a "protected" sheet. My requirement was, after reset filter drop down should not be removed but data should be reset to first.
So found macros which does this operation as mentioned below
On Error Resume Next
ActiveSheet.Unprotect Password:="mypassword"
ActiveSheet.ShowAllData
ActiveSheet.Protect Password:="mypassword"
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True, AllowFiltering:=True
This works fine and fulfilled my requirement. But after clicking on 'Reset Filter Button' (Which I created to assign macro), removing password from my protected sheet or Unprotect the sheet!!!
My sheet should remain password protected.
Can anyone please suggest, how to get rid of this problem. I will be greaful
Thanks in Advance!!
Pritish
My requirement: I'm using MS-Excel 2007. I have a protected sheet with 10 columns where I applied filter. during protecting my sheet I have selected the option 'AutoFilter" checked. But the problem I faced, if I filter data from all 10 columns, I cant reset all filters in a single click. I have to clear filter one by one.
To resolve this I have created a button and macro to clear/ reset filter in a "protected" sheet. My requirement was, after reset filter drop down should not be removed but data should be reset to first.
So found macros which does this operation as mentioned below
On Error Resume Next
ActiveSheet.Unprotect Password:="mypassword"
ActiveSheet.ShowAllData
ActiveSheet.Protect Password:="mypassword"
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True, AllowFiltering:=True
This works fine and fulfilled my requirement. But after clicking on 'Reset Filter Button' (Which I created to assign macro), removing password from my protected sheet or Unprotect the sheet!!!
My sheet should remain password protected.
Can anyone please suggest, how to get rid of this problem. I will be greaful
Thanks in Advance!!
Pritish