Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 09-19-2021, 12:23 PM
grumblid grumblid is offline Ways to count how many times a word occurs? Windows 7 64bit Ways to count how many times a word occurs? Office 2003
Novice
Ways to count how many times a word occurs?
 
Join Date: Jul 2016
Posts: 23
grumblid is on a distinguished road
Default Ways to count how many times a word occurs?

I know that when you're on an individual document and press Ctrl+F, you can specify a word to see how many times it occurs. But I have an odd situation where I want to see how many times a word occurs in entire folder full of documents (some with their own sub-folders) so I don't have to Ctrl+F each one and add to the total number; document by document.

Is there a way to do this, or do I pretty much have to do it the way I mentioned?

This isn't the word, but here's a similar example to mine: Say the word was "OKAY!" Case-sensitive and has to have the exclamation mark at the end.

Thanks for any help with my odd question!
Reply With Quote
  #2  
Old 09-25-2021, 01:04 AM
Stefan Blom's Avatar
Stefan Blom Stefan Blom is offline Ways to count how many times a word occurs? Windows 10 Ways to count how many times a word occurs? Office 2019
Moderator
 
Join Date: Aug 2011
Posts: 3,871
Stefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to all
Default

A simple way to find out the number of occurrences of a word is to replace it with itself. When you click the Replace All button, Word reports the number of replacements.

For a single document, you can use the macro in the article How to find out, using VBA, how many replacements Word made during a Find
& Replace All
.

Since you want to process all the documents in a folder, you would have to combine this with code that iterates through multiple documents. This is not a trivial task, of course.
Attached Images
File Type: png ReplaceWordWithItself.PNG (29.2 KB, 12 views)
__________________
Stefan Blom
Microsoft Word MVP

Microsoft 365 apps for business
Windows 11 Professional

Last edited by Stefan Blom; 09-25-2021 at 05:01 AM.
Reply With Quote
  #3  
Old 09-28-2021, 05:32 PM
Charles Kenyon Charles Kenyon is offline Ways to count how many times a word occurs? Windows 10 Ways to count how many times a word occurs? Office 2019
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,081
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

The following may help with handling multiple documents:
Reply With Quote
  #4  
Old 09-29-2021, 01:24 AM
Stefan Blom's Avatar
Stefan Blom Stefan Blom is offline Ways to count how many times a word occurs? Windows 10 Ways to count how many times a word occurs? Office 2019
Moderator
 
Join Date: Aug 2011
Posts: 3,871
Stefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to all
Default

Useful references!
__________________
Stefan Blom
Microsoft Word MVP

Microsoft 365 apps for business
Windows 11 Professional
Reply With Quote
Reply

Tags
count, counter, counting

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Ways to count how many times a word occurs? How can I count per year and per week the total number of times a code occurs Stefan_Deckers Excel 3 09-19-2020 02:36 PM
Ways to count how many times a word occurs? How do you count how often a specific value occurs in single changing cell? blackjack Excel 12 09-03-2014 10:41 AM
Ways to count how many times a word occurs? Logic formula to only count patient once, even though they are listed multiple times Carol Salcido Excel 17 02-26-2014 03:57 PM
Ways to count how many times a word occurs? Data from excel to word? /alternative ways? slimhan Excel 1 11-17-2012 08:17 PM
Ways to count how many times a word occurs? count how many tims a certain value occurs lucnijs Excel 6 03-26-2012 09:29 AM

Other Forums: Access Forums

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


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