ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Counting Rows (https://www.excelbanter.com/excel-discussion-misc-queries/94156-counting-rows.html)

CLamar

Counting Rows
 
I am trying to count the number of rows between empty rows (excluding the
heading). My data is setup like this in the worksheet. Can anyone suggest a
method to do this in VBA?

heading1 heading2 heading3
1 1 1
2 2 2
3 3 3

heading1 heading2 heading3
4 4 4
5 5 5
6 6 6

Don Guillett

Counting Rows
 
I would probably use something like
fbr=range("a1").end(xldown).row
nbr=cells(fbr,1).end(xldown.row
nrs=nbr-fbr
fbr=nbr


--
Don Guillett
SalesAid Software

"CLamar" wrote in message
...
I am trying to count the number of rows between empty rows (excluding the
heading). My data is setup like this in the worksheet. Can anyone suggest
a
method to do this in VBA?

heading1 heading2 heading3
1 1 1
2 2 2
3 3 3

heading1 heading2 heading3
4 4 4
5 5 5
6 6 6





All times are GMT +1. The time now is 02:42 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com