title: Unprotecting a worksheet using vba
body: <p>I have a macro that already exists. Since creating that macro, I decided that some of the worksheets should be protected before proceeding with the macro.</p>
  <pre><code> Range(&quot;A1:G3177&quot;).Select
      Selection.Copy
      Sheets(&quot;Hastus Workbook&quot;).Select
      Range(&quot;A1&quot;).Select
      Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
          :=False, Transpose:=False
   Sheets(&quot;Chart&quot;).Select
  
  </code></pre>
  <p>I protected the &quot;Hastus Workbook&quot; sheet by right clicking on the sheet name in excel. I would like  to add a line to the code above that will unprotect this worksheet as part of my already-existing macro.</p>
  <p>I tried inserting <code>Sheets(&quot;Hastus Workbook&quot;).Unprotect &quot;password&quot;</code> above the <code>Sheets(&quot;Hastus Workbook&quot;).Select</code> line, but this did not work. How can I make unprotect this sheet?</p>
  <p>Thanks for the help!</p>