title: How to determine the last Row used in VBA including blank spaces in between
body: <p>How can I determine the last row in an Excel sheet, including some blank lines in the middle?</p>
  
  <p>With this function:</p>
  
  <pre><code>Function ultimaFilaBlanco(col As String) As Long        
          Dim lastRow As Long
          With ActiveSheet
              lastRow = ActiveSheet.Cells(ActiveSheet.Rows.Count, col).End(xlUp).row
          End With            
          ultimaFilaBlanco = lastRow          
  End Function
  </code></pre>
  
  <p>And this data:</p>
  
  <pre><code>Row 1 : Value
  Row 2 : Value
  Row 3 : Value
  Row 4 : Value
  Row 5 : Value
  Row 6 : White
  Row 7 : Value
  Row 8 : Value
  Row 9 : Value
  Row 10  : White
  Row 11  : White
  Row 12  : White
  Row 13  : Value
  Row 14  : White
  </code></pre>
  
  <p>The function returns 5, and I need 13. Any idea how to do it? </p>