title: Code to protect workbook ignores exceptions and range
body: <p>I have created some VBA code using snippets online with the aim of locking down a worksheet so that the header column cannot be edited, nor any rows or columns being inserted or deleted. However the main data needs to be editable and for ease of use by the end user, filtering and sorting needs to be possible. However, the code just creates a completely locked workbook- no editing, sorting, or filtering is possible.</p>
  
  <pre><code>    Rows(1).Locked = True
      ActiveSheet.Protect Password:="Psswrd"
      ActiveSheet.Protect Contents:=False
      AllowInsertingColumns = False
      AllowInsertingRows = False
      AllowSorting = True
      AllowFiltering = True
  </code></pre>