title: How to change the Height of Multiple rows at Once?
body: <p>How do I change the height of multiple rows at once via Google Apps Script?</p>
  
  <p><strong>Attempt:</strong></p>
  
  <pre><code>function resizeHeight() {
  
    var s = SpreadsheetApp,
        ui = s.getUi(),
        sh = s.getActiveSheet(),
        curntRow = s.getActiveRange().getRow(),
        rowsMany = s.getActiveRange().getNumRows(),
        autoRangeRows = s.getActiveRange().getA1Notation().replace(/[a-z]/gi,""),
        getVal = ui.prompt('⿱⇕', 'Change the height of row❓   Cancel. Back to default❗  (21)', ui.ButtonSet.OK_CANCEL),
        Btn = getVal.getSelectedButton(), Txt = getVal.getResponseText();
  
      for (var i=curntRow; i&lt;=rowsMany+1; i++) {
        if (Btn == 'OK') {
           if (autoRangeRows.search(":") == -1) {sh.setRowHeight(curntRow, Txt);}
           else {sh.setRowHeight(i, Txt);}
        }
        if (Btn == 'CANCEL') {
           if (autoRangeRows.search(":") == -1) {sh.setRowHeight(curntRow, 21);}
           else {sh.setRowHeight(i, 21);}
        }
     }
  }
  </code></pre>
  
  <p><strong>Problem:</strong></p>
  
  <p>The script is not very effective they only work on the part or a few rows but not on all rows can be implemented.</p>