I have a question regarding how to count cells in excel using vba, I've found this code but is not working as intended
Dim count As Long
count= ActiveSheet.Range("B5", ActiveSheet.Cells(Rows.count,1).End(xlDown)).Rows.count
MsgBox count
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)
I also have found how to assign the values from the range to the array as
MyVector = Range("B5:B" & count).Value
But I don't know how to know the count variable
Any help would be much appreciated