smiley3141
Board Regular
- Joined
- Aug 13, 2010
- Messages
- 77
Hello Everyone. I am using Excel 2007 and I cannot get my table to allow filtering when my worksheet is password protected. I recorded a macro to unprotect the worksheet, sort the table, then protect the worksheet again. My problem is that when I protect the sheet again, I lose the ability to filter the table even though the macro includes the following code when it protects the sheet again.
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True, AllowFiltering:=True
By trying different things I have found that if I password protect the sheet BEFORE the above code, filtering still works but the page is no longer password protected. It is simply protected (without a password). If I password protect the sheet after the above code, the sheet is password protected, but then I cannot filter the table.
Is there some way to allow filtering AND to have the sheet password protected?
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True, AllowFiltering:=True
By trying different things I have found that if I password protect the sheet BEFORE the above code, filtering still works but the page is no longer password protected. It is simply protected (without a password). If I password protect the sheet after the above code, the sheet is password protected, but then I cannot filter the table.
Is there some way to allow filtering AND to have the sheet password protected?