title: How to lock specific cells but allow filtering and sorting
body: <p>I'm using the following code to lock the content of certain cells</p>
  
  <pre><code>Sub LockCell(ws As Worksheet, strCellRng As String)
    With ws
     .Unprotect
     .Cells.Locked = False
     .Range(strCellRng).Locked = True
     .Protect Contents:=True, AllowFormattingCells:=True, AllowFormattingColumns:=True, AllowFormattingRows:=True, AllowInsertingColumns:=True, AllowInsertingRows:=True, AllowSorting:=True, AllowFiltering:=True, AllowUsingPivotTables:=True, DrawingObjects:=True
    End With
  End Sub
  </code></pre>
  
  <p>It locks the content of those specific columns. The problem is users cannot sort, neither filter, nor apply borders to the cells since those Excel menu items are disabled.</p>
  
  <p>I thought the <code>AllowSorting:=True</code>, <code>AllowFiltering:=True</code> and <code>DrawingObjects:=True</code> would allow that the same way the <code>AllowFormattingColumns:=True</code> and <code>AllowFormattingRows:=True</code> allowed resizing.</p>