title: Hide and Unhide a range of rows based on the value in a cell
body: <p>Very Basic I am sure but I can't figure it out for the life of me.</p>
  <p>I have a set of radio buttons that changes the value of cell(&quot;L37&quot;) between 1 and 2.</p>
  <p>I have tried to write the VBA code several different ways without luck. Please advise.</p>
  <pre><code>Sub hide_sheet()
      If Worksheets(&quot;Feedback&quot;).Range(&quot;L37&quot;).Value = 1 Then
        Rows(&quot;63:93&quot;).EntireRow.Hidden = True
      Else Worksheets(&quot;Feedback&quot;).Range(&quot;L37&quot;).Value = 2 Then
        Worksheets(&quot;Feedback&quot;).Rows(&quot;63:93&quot;).EntireRow.Hidden = False
      End If
  End Sub
  </code></pre>
  <p>I had it working perfectly fine via a Macro tied to the radio buttons; however, due to me needing to protect the sheet I needed to change it.</p>
  <p>I am using a protect/unprotect VBA code and would like to include it into the code so it won't set off the macro/sheet protected warning.</p>
  <p>Here is my protect/unprotect code I am using for everything.</p>
  <pre><code>Sub unprotect()
  
      Worksheets(&quot;Feedback&quot;).unprotect
      
  End Sub
  
  Sub protect()
  
      Worksheets(&quot;Feedback&quot;).protect , _
          AllowFormattingCells:=True, _
          AllowFormattingRows:=True
          
      
  End Sub
  </code></pre>
  <p>Any advice would be greatly appreciated. I Thank You in Advance of your assistance.</p>