Reputation: 1843
I'd like to reliably count the number of rows in a given excel table using excel formulas.
The rough equivalent of:
ActiveWorkbook.Worksheets("Sheet1").Range("Table1").Rows.Count
Using built-in Excel formulas.
Upvotes: 2
Views: 99
Reputation:
For a non-volatile count of the rows in the table including the headers,
=ROWS(INDEX(Table1[#All], 0, 1))
For the rows in the .DataBodyRange without the header row,
=ROWS(INDEX(Table1, 0, 1))
Upvotes: 2
Reputation: 1843
I think I may have found a nice solution while researching this question:
=ROWS(INDIRECT("Table1"))
Feel free to post other options!
Upvotes: 2