View Single Post
 
Old 08-21-2016, 06:29 AM
gmayor's Avatar
gmayor gmayor is offline Windows 10 Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,137
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

The macro looks for two bookmarks named "Sustainability" and "TeamWorking" which relate to the bookmarks in your illustration (where they are not named). Change those names in the macro to the actual names and the macro will work to add or update the table shown in your illustration.

To get the word count of the bookmarked range containing the cursor

Code:
Dim orng As Range
    Set orng = Selection.Bookmarks(1).Range
    MsgBox orng.Words.Count
Paul is right, that bookmarks are not necessary, especially if you are going to do the job manually. Even with a macro you could have counted the words in the table cell without the need for a bookmark.
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote