Counting specific words in Word 2007

T

TxBikeRider

I need to be able to go through a document (either 2003 or 2007) in Word 2007
and count all the occurrences of a specific word. There doesn't seem to be a
"canned" way of doing that in the actual application.

Any suggestions?

Jim
 
J

Jay Freedman

Open the Replace dialog (Ctrl+H). Enter the specific word in the Find What
box, and enter the code ^& in the Replace With box (the code means "the
same thing that was just found"). Click the Replace All button. Word will
display a message box telling you how many replacements it did. Since you
replaced the word with itself, there won't be any change in the document.

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
G

Graham Mayor

Use the replace function (CTRL+H)
Enter the word to count in the find what box and ^& in the replace with box.
Replace all. The function will give you the number of times the word was
replaced ie the number of occurrences of that word.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
S

Suzanne S. Barnhill

While replacing a word with itself (as Jay and Graham suggest) will
certainly give you the desired results, Word 2003 and 2007 also offer
another method. Use Ctrl+F to open the Find dialog. Type the word in the
"Find what" box, check the box for "Highlight all items found," and click
Find All. Word will tell you how many it found. Better still, they'll all be
selected, in case you want to, say, apply specific formatting to them.
 
E

Ember

I have seen this suggestion multiple times in this forum. But I would like
to take it a step further.

I have a word 2007 document with information contained in a table. The
table has five columns with one of them being "Assigned To". I would like to
know if there is a way, or formula, that would count the number of times a
person's name appeared in this column.

The change here is that this count could/would change as a person signed up
for more items on the table. Is this possible?

Thanks!
 
D

Doug Robbins - Word MVP

With the selection in one of the cells that contains the name for which you
want the count, run a macro containing the following code:

Dim Name As Range
Dim i As Long, j As Long, colnum As Long
colnum = Selection.Information(wdEndOfRangeColumnNumber)
j = 0
Set Name = Selection.Cells(1).Range
With Selection.Tables(1)
For i = 1 To .Rows.Count
If .Cell(i, colnum).Range.Text = Name.Text Then
j = j + 1
End If
Next i
End With
Name.End = Name.End - 1
MsgBox j & " activities have been assigned to " & Name.Text & "."


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top