Number of rows within a range

Guitarde

Board Regular
Joined
Mar 18, 2003
Messages
238
I usually use the following code to get the number of rows:
Range("data").Select
vNbRow = Selection.Rows.Count

Is there a way to get this without any Select
...something like Range("data").Rows.Count (this is not working).


Thanks
Eric
 

Some videos you may like

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,059
Office Version
  1. 365
Platform
  1. Windows
Eric

How is it not working?

Is this what you are trying? It seems to work for me.
Code:
vNbRow = Range("data").Rows.Count
 

Watch MrExcel Video

Forum statistics

Threads
1,118,530
Messages
5,572,675
Members
412,481
Latest member
nhantam
Top