title: How to hide rows based off of text in another cell
body: <p>I am trying to hide rows depending on a different cell. For example, if that cell is &quot;No&quot;, I want to automatically hide the following 3 rows since they will no longer pertain. (B14=No, hide rows 14-16). Any help is greatly appreciated!</p>
  <pre><code>    function onEdit(e){
  
    if(e.range.getA1Notation() === 'B14' &amp;&amp; e.range.getSheet().getName()=='PST Referral Template (Sheet)'){
      if(e.value=='No') {
      } e.range.getSheet().hideRows(15,16,17);
     
     if(e.range.getA1Notation() === 'B19' &amp;&amp; e.range.getSheet().getName()=='PST Referral Template (Sheet)'){
       if(e.value=='No') {
       } e.range.getSheet().hideRows(20,21,22);
        
    if(e.range.getA1Notation() === 'B24' &amp;&amp; e.range.getSheet().getName()=='PST Referral Template (Sheet)'){
      if(e.value=='No') {
      } e.range.getSheet().hideRows(25,26,27);
     
     if(e.range.getA1Notation() === 'B29' &amp;&amp; e.range.getSheet().getName()=='PST Referral Template (Sheet)'){
       if(e.value=='No') {
       } e.range.getSheet().hideRows(30,31);
         
    if(e.range.getA1Notation() === 'B37' &amp;&amp; e.range.getSheet().getName()=='PST Referral Template (Sheet)'){
      if(e.value=='No') {
      } e.range.getSheet().hideRows(38,39);
     
     if(e.range.getA1Notation() === 'B41' &amp;&amp; e.range.getSheet().getName()=='PST Referral Template (Sheet)'){
       if(e.value=='No') {
       } e.range.getSheet().hideRows(42,43);
        
    if(e.range.getA1Notation() === 'B45' &amp;&amp; e.range.getSheet().getName()=='PST Referral Template (Sheet)'){
      if(e.value=='No') {
      } e.range.getSheet().hideRow(46);
     
     if(e.range.getA1Notation() === 'B48' &amp;&amp; e.range.getSheet().getName()=='PST Referral Template (Sheet)'){
       if(e.value=='No') {
       } e.range.getSheet().hideRow(49); 
     }
    }
     }
  </code></pre>