Thread: [Solved] Counting rows with a macro?
View Single Post
 
Old 08-23-2016, 08:12 AM
Jennifer Murphy's Avatar
Jennifer Murphy Jennifer Murphy is offline Windows XP Office 2007
Competent Performer
 
Join Date: Aug 2011
Location: Silicon Valley
Posts: 234
Jennifer Murphy is on a distinguished road
Default Counting rows with a macro?

In this thread, Andrew Lockton posts a macro that will display the number of rows in a selected table:

https://www.msofficeforums.com/word/...ows-table.html

The macro is:
Code:
Sub CountRows()
   msgbox Selection.Tables(1).Rows.Count
End Sub
Is there a way to make this into a function that will return the number of rows in a table if called from a cell in that table?
Reply With Quote