Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 08-21-2016, 06:29 AM
gmayor's Avatar
gmayor gmayor is offline Macro to return a word count of text contained within a bookmark Windows 10 Macro to return a word count of text contained within a bookmark Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,142
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
Reply

Tags
word count macro



Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to return a word count of text contained within a bookmark FORMTEXT field contained in INCLUDETEXT bookmark emwinschuh Word 1 08-17-2015 08:55 AM
Macro to return a word count of text contained within a bookmark A recurring word count macro? bpanda Word VBA 1 06-11-2013 07:17 AM
Macro to return a word count of text contained within a bookmark Word Count Macro bpanda Word VBA 1 01-11-2013 06:51 PM
Macro to return a word count of text contained within a bookmark Word 2003 - IncludeText Does Not Include Bookmark Text if in a Form Text Control skarden Word 1 12-12-2011 10:39 PM
*Word 2007 Macro for Character Count gbartlet Word 0 07-21-2010 11:12 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 07:02 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft