Count of Underlined or Struck-Through Words

by Allen Wyatt
(last updated March 29, 2014)

9

Tricia has a lot of documents that she works with for her employment. These documents have many words that are underlined and many others that have "strikethrough" formatting. Tricia needs a way, at any given time, to know how many words in the document are underlined and how many are "struck through."

There are a couple of non-macro approaches you can use to get the counts you need, both of which are quick and easy. Here's one that is rather esoteric, but works great:

  1. Open the document that has the formatted words you want to count.
  2. Open a second, blank document.
  3. Switch back to the original document.
  4. Select one of the words you want to count. (For instance, if you want to count underlined words, select one of the underlined words.)
  5. Display the Home tab of the ribbon.
  6. Click the Select tool (Editing group) and then click Select Text with Similar Formatting. Word selects all the words that have the same formatting as the word you selected in step 4.
  7. Press Ctrl+C. This copies all the words to the Clipboard.
  8. Switch to the blank document.
  9. Press Ctrl+V. This pastes all the words into the new document.
  10. Look at the status bar where you'll see a count of all the words in the document, which is all the words you just pasted.

There is one caveat to this approach: When you use the Select Text with Similar Formatting, Word is pretty discriminating in what it selects. For instance, if you have a word that is bold and underlined, but you select a word that is non-bold and underlined in step 4, then the bold and underlined word is not selected after step 6. The reason is that Word considers the bolding enough of a "disqualifier" that the formatting is no longer similar. Still, if your words use simple underlining or simple strikethrough, then these steps will work quickly and easily. (Plus, you get the benefit of having the words themselves in a different document where you can further analyze them.)

Another approach is to use the Find and Replace feature of Word to derive the count. Follow these steps, for example, if you want to find the count of words that are struck through:

  1. Open the document that has the formatted words you want to count.
  2. Press Ctrl+H. Word displays the Replace tab of the Finda and Replace dialog box.
  3. Click the Find tab.
  4. Click the More button, if it is available. (See Figure 1.)
  5. Figure 1. The Find tab of the Find and Replace dialog box.

  6. Click Format | Font. Word displays the Find Font dialog box. (See Figure 2.)
  7. Figure 2. The Find Font dialog box.

  8. Click the Strikethrough check box until it contains a check mark.
  9. Click OK to close the Find Font dialog box.
  10. Click the Use Wildcards check box.
  11. In the Find What box, enter the following: <[A-Z,a-z]@>
  12. Click Reading Highlight | Highlight All. Word highlights all the words that match the specification and it displays the count of the matches in the dialog box.

Word does a good job of highlighting individual words if you use this approach. Thus, if you have the text "John followed the path for about a mile", these steps will see this as 8 separate words and reflect that in the count. The reason is because of the pattern matching you specified in step 9. It indicates that the match must be at the beginning and end of a word.

The search pattern you specify in step 9 will match only words that contain uppercase or lowercase letters. It won't match words that contain (beginning, middle, or end) any numbers. Thus, the word "CH2M" (an actual portion of a company name) would not be considered a match. If you believe you may have digits in some of your words, then use the search pattern <[A-Z,a-z,0-9]@> in step 9, instead.

If you decide to use the Find and Replace approach, you'll need to repeat the steps for each type of formatting you want to find. Actually, if you are going to get your counts all at the same time, you can simply repeat steps 5 through 10 over and over again, selecting a different formatting option each time in step 6. (Word actually has two strikethrough settings and 16 or so different types of underlining.)

While the two methods of getting counts discussed in this tip focus on counting underlined or struck-through words, the same two techniques can be used to search for any type or mix of formatting you desire; they are very versatile.

WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (13039) applies to Microsoft Word 2007, 2010, and 2013.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He  is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Using Seek In a Macro

When processing non-document text files in a macro, you have a wide range of commands available for your use. One of those is ...

Discover More

Adding Drop Shadows to Cells

Want to draw attention to what is in a cell? What better way than to add a drop shadow to that cell! Here's how you can do ...

Discover More

Removing Pictures from Multiple Files

Working with a single document is easy. Working with thousands of documents becomes much harder. If you need to get rid of ...

Discover More

The First and Last Word on Word! Bestselling For Dummies author Dan Gookin puts his usual fun and friendly candor back to work to show you how to navigate Word 2013. Spend more time working and less time trying to figure it all out! Check out Word 2013 For Dummies today!

More WordTips (ribbon)

Searching for Text that Doesn't End a Paragraph

The Find and Replace capabilities of Word are very powerful, particularly if you are using wildcards in your search. Here's ...

Discover More

Replacing Hidden Text

Word allows you to format text so it can be easily hidden from view and from printing. If you want to convert the hidden text ...

Discover More

Changing Decimal Commas to Decimal Points

If you have a document that was produced in a country where decimal commas are used instead of decimal points, you may be ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] in your comment text. You’ll be prompted to upload your image when you submit the comment. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is six more than 8?

2016-11-10 22:15:59

Michael

The find feature works great. However, I need to do this in a VBA program.
Recording a Macro produced this code:
Selection.Find.ClearFormatting
With Selection.Find
.Text = "<[A-Z,a-z]@>"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Wow can I get the count displayed in the dialog box so I can return it in a function?
Thanks


2014-04-08 08:46:40

Ken Endacott

Here is a macro for counting underscore and strike through words in the body of the document. It the macro becomes more complicated if you also want to include other parts of the document such as headers and footers.

Sub UScount1()
' Count of underscored or struck through words for document body only
Dim w
Dim wcount As Long
Dim scount As Long
Dim ucount As Long
Dim bothcount As Long

wcount = 0
scount = 0
ucount = 0
bothcount = 0

For Each w In ActiveDocument.Content.Words
If w <> "" Then
If Asc(w) > 64 Then
wcount = wcount + 1
With w.Font
If .StrikeThrough <> 0 Then scount = scount + 1
If .Underline <> 0 Then ucount = ucount + 1
If .StrikeThrough <> 0 And .Underline <> 0 Then bothcount = bothcount + 1
End With
End If
End If
Next w
MsgBox wcount & " total words" & vbCrLf & _
scount & " words have strikethrough" & vbCrLf & _
ucount & " words are underlined" & vbCrLf & _
"Includes " & bothcount & " words that have both underlining and strikethrough"
End Sub


2014-03-31 10:03:31

Tricia

Thank you so much for this tip! It is easy to use and very helpful!


2014-03-31 09:03:09

awyatt

Allan (and Tony and K.Vee):

I try, in all the tips here, to provide information on how to do things both with and without macros. For some topics, however, macros are the only way that a particular task can be accomplished.

(In the case of this particular tip, macros aren't the only or best way to accomplish it; that's why a macro wasn't provided.)

If you know nothing about macros and want to know more, the best course of action I can offer is this book:

http://store.tips.net/T010352

Hope that helps.

-Allen


2014-03-31 01:03:14

K.Vee.Shanker.

@Tony.
Here, here!

One of the grouses I've about this site, is that many tips employ Macros. They might be intimidating to casual users.


2014-03-30 22:24:11

Tony

I'm actually glad it's a non-macro tip.


2014-03-30 04:39:00

Allan

I love your tips, Allen. Thank you. Could you tell me how to make use of macros? I know absolutely nothing about that topic. Thank you again. Allan


2014-03-29 13:21:11

Ann Daugherty

Excellent tip. Is there a macro for this?


2014-03-29 05:12:34

sarma

It would be highly helpful if there's a macro for this.


This Site

Got a version of Word that uses the ribbon interface (Word 2007 or later)? This site is for you! If you use an earlier version of Word, visit our WordTips site focusing on the menu interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.