title: VBA Count number of cells in range
body: <p>Trying to count the number of cells within a range to display on the status bar. Not sure how to count the number of cells within the range to use as the denominator for the progress bar. Any thoughts?</p>
  
  <pre><code>For Each cell In Range("E11:G28,E33:G50,E57:G74,E79:G96,E101:G118,E130:G147,E152:G169,E175:G192,E198:G215,E221:G238")
      **lTotal = Range.Cells.Count**
      Application.StatusBar = "Processing cell " &amp; cell.AddressLocal &amp; _
                                      "    " &amp; Format((lCounter / lTotal), "0%")
      cell.EntireRow.Hidden = (cell.Value = "")
      lCounter = lCounter = 1
  Next cell
  </code></pre>
  
  <p>Many thanks</p>