title: How to count rows in excel starting in specified cell with vba macro
body: <p>I have a question regarding how to count cells in excel using vba, I've found this code but is not working as intended</p>
  
  <pre><code>Dim count As Long
  count= ActiveSheet.Range("B5", ActiveSheet.Cells(Rows.count,1).End(xlDown)).Rows.count
  MsgBox count
  </code></pre>
  
  <p>My problem is, lets say my data header is in cell B4 and my data starts starts from B5 to an unknown row in the same B column. How could I count how many rows are filled (starting from B5) ?   (there are no blank cells) </p>
  
  <p>I also have found how to assign the values from the range to the array as</p>
  
  <pre><code> MyVector = Range("B5:B" &amp; count).Value
  </code></pre>
  
  <p>But I don't know how to know the count variable</p>
  
  <p>Any help would be much appreciated</p>