Logo 
Search:

MS Office Forum

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds

Sorting and Autofiltering after Protecting a worksheet

  Asked By: Almas    Date: Mar 02    Category: MS Office    Views: 740
  

I have unlocked all cells, then I have locked the columns I wanted
protected and then password protected the sheet using the following
code:

ActiveSheet.Protect _
DrawingObjects:=True, _
Contents:=True, _
Scenarios:=True, _
AllowFormattingCells:=True, _
AllowFormattingColumns:=True, _
AllowFormattingRows:=True, _
AllowSorting:=True, _
AllowFiltering:=True, _
Password:="password"

However, after protecting, the columns ARE protected,
But the sort & autofilter options are grayed out in the menu (don't
work!)

Can anyone tell me why?

Share: 

 

2 Answers Found

 
Answer #1    Answered By: Djoser Massri     Answered On: Mar 02

but I would try unlocking the row where the filter arrows are.

 
Answer #2    Answered By: Sherrie Thomas     Answered On: Mar 02

If any of the cells  in the range to be sorted/filtered are locked, you can't
sort or filter them with sheet  protection on, in spite of setting AllowSorting
and AllowFiltering to TRUE. You could unlock all the cells in the range to be
sorted/filtered, or you could use macros to unprotect the sheet, sort  a
particular column, and re-protect the sheet.

 
Didn't find what you were looking for? Find more on Sorting and Autofiltering after Protecting a worksheet Or get search suggestion and latest updates.