Allowing "Sort" in a Protected Worksheet - Microsoft Community


want publish excel worksheet others use , manipulate, keep data protected.  why, if excel allows protect spreadsheet "sort" option ("use commands sort data (data tab, sort & filter group"), program tie our hands "note: users can't sort ranges contain locked cells on protected worksheet, regardless of setting."  why listed option?  if others cannot "sort ranges" in worksheet want protect data, it?  it seems defeats purpose.

you can protect sheet in code follows:

worksheets("mysheet").protect allowsorting:=true, userinterfaceonly:=true

specifying true userinterface argument allow manipulate worksheet in vba code though protected. example, sorting worksheet.

you must include version of the above line in workbook_open event procedure in thisworkbook module, userinterfaceonly:=true not saved workbook.



Office / Excel / Microsoft Office Programming



Comments

Popular posts from this blog

Getting ErrorCode: 120018 when trying to access Microsoft account - Microsoft Community

The message was sent to a distribution list ‎(DL)‎ - Microsoft Community

Activation Error 0x8004FE93 - Microsoft Community