title: Excel VBA Function to hide/unhide Rows
body: <p>I am new to VBA/Macro.  I need some help figuring how to hide/unhide rows given my scenario.  This is my table:</p>
  
  <p>See Table: <a href="https://i.stack.imgur.com/Y5rj1.png" rel="nofollow noreferrer">enter image description here</a></p>
  
  <p>What I would like to do is:</p>
  
  <p>1) Create a function (or sub) with three arguments: </p>
  
  <ul>
  <li>FlagRange:  flagRange or C1:C9</li>
  <li>hideAction: True/False </li>
  <li>Flag: This is one of the flag value</li>
  </ul>
  
  <p>Example:  Hide_Unhide(flagRange, True, "P")</p>
  
  <p>2) This function will hide all the row(s) based on the Flag that is passed into the argument.</p>
  
  <p>Any suggestions and samples are appreciated.</p>