title: Resize Rows using if else in GAS
body: <p>I am working on a script in which if a cell in col10 has a value it will auto resize the the row otherwise it will set the row height, in this case the row height is 72</p>
  <p>The following image is a screenshot of what I am trying to achieve here</p>
  <p><a href="https://i.stack.imgur.com/dTU6g.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dTU6g.jpg" alt="enter image description here" /></a></p>
  <pre><code>function reset_rows_auto() {
        
      var ss = SpreadsheetApp.getActiveSpreadsheet();
      var sheet = ss.getActiveSheet(); 
      
      var lastRow = sheet.getMaxRows().toString();
      var lastRow = lastRow.replace(&quot;.0&quot;,&quot;&quot;); 
      
      for (var i = 1; i &lt; lastRow; i++) {
        
        var abc = sheet.getRange(i, 10) //col10
        
      if (abc != &quot;&quot;) {
        
          sheet.autoResizeRows([i],1)
      
          } 
        
      else if (abc == &quot;&quot;) {
       
       sheet.setRowHeight([i], 72)
          
          }
        } 
      }
  </code></pre>
  <p>Every time I run the script its, only auto resizing the row and not setting the row height of rows which have blank cell in Col10. I am not being able to figure the error out here, could anyone please help</p>
  <p>Thanks in advance!</p>