Find numbers and recurrence of a text in Word docs

Strootman

New Member
Joined
Sep 22, 2017
Messages
2
Hello,

I have an excel sheet with a list of texts that I have to locate in a folder with multiple Word documents.
What I want to obtain is, for every text, a report of the number of recurrences found for each documents and the page where the text is present.
I was able to find a code to count the occurrences by converting the documents in .txt, but then I lose the page reference.

Just as an example, imagine the Excel sheet containing a column with the texts to look for:

"Burt"
"Homer"
"Lisa"
"Maggie"
"Marge"

And a folder containing the following Word files:

"Belgium", "Italy", "France", "Germany", "Spain"

I would like the report (still excel) to look something like:

Text Word doc Occurrences Found on Pages

Burt Belgium 4 3,5,7,9
France 3 2,6,9

Homer Italy 1 12

And so on.
Is this possible?

Thanks
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
[TABLE="width: 500"]
<tbody>[TR]
[TD]Text[/TD]
[TD]Word doc[/TD]
[TD]Occurrences[/TD]
[TD]Found on Page[/TD]
[/TR]
[TR]
[TD]Burt[/TD]
[TD]Belgium[/TD]
[TD]4[/TD]
[TD]3,5,7,9[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]France[/TD]
[TD]3[/TD]
[TD]2,6,9[/TD]
[/TR]
[TR]
[TD]Homer[/TD]
[TD]Italy[/TD]
[TD]1[/TD]
[TD]12[/TD]
[/TR]
</tbody>[/TABLE]

Just realized that the post lost the formatting after submit, the example table should look like the one above.
 
Upvote 0

Forum statistics

Threads
1,223,231
Messages
6,170,884
Members
452,364
Latest member
springate

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top