Range.Count Property in Excel VBA

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
Learn about data types in VBA in my blog post here.
Learn how to run code snippets in the immediate window in my blog post here.

Join the Newsletter