By Hemanta Sundaray on 2021-09-08
We can count the number of cells in a range using the Range.Count property, which returns a Long value.
Note that the following code snippets have been executed in the immediate window of the visual basic editor.
? Range("A1:B2").Count
4
' no. of cells in column A
? Range("A:A").Count
1048576
' no. of cells in row 5
? Range("5:5").Count
16384