Please Note: This article is written for users of the following Microsoft Word versions: 97, 2000, 2002, and 2003. If you are using a later version (Word 2007 or later), this tip may not work for you. For a version of this tip written specifically for later versions of Word, click here: Sorting by Headings.

Sorting by Headings

by Allen Wyatt
(last updated January 28, 2012)

16

A useful trick you can use when developing some types of documents is the ability to sort the various parts of the document based on the headings you use. For instance, you can sort the document based on first-level headings (paragraphs that use the Heading 1 style) by following these steps:

  1. Switch to Outline view by clicking on the Outline view button that appears just to the left of the horizontal scroll bar.
  2. Using the controls on the Outlining toolbar, collapse the headings so that only the first-level headings are shown. (This step is not strictly necessary, but does make the screen a bit more readable.)
  3. Place the cursor at the beginning of the first heading and press Ctrl+Shift+End to select everything through the end of the document.
  4. Choose Sort from the Table menu. Word displays the Sort Text dialog box. (See Figure 1.)
  5. Figure 1. The Sort Text dialog box.

  6. Click on OK to accept the default settings in the dialog box.

Had you skipped the first two steps and performed the sort in any view besides Outline view, every paragraph would have been sorted alphabetically and therefore rearranged so that subordinate paragraphs would be separated from their headings. In other words, you would have a mess. However, in Outline view, the highest-level headings are sorted, bringing along the subordinate heading levels and body text.

If you wanted to sort by Heading 2 paragraphs, you should also use Outline view, but you would have to first select all the Heading 2 paragraphs subordinate to a particular Heading 1 paragraph and then sort. You will get the same results regardless of how many heading levels that you show on the Outline toolbar.

WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (41) applies to Microsoft Word 97, 2000, 2002, and 2003. You can find a version of this tip for the ribbon interface of Word (Word 2007 and later) here: Sorting by Headings.

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

Controlling Display of Page Breaks

Do you want page breaks displayed on the screen? Excel allows you to specify whether it should show those page breaks or not.

Discover More

Inserting Special Spaces

Do you need to frequently add en spaces and em spaces to your documents? You can add special tools to Word that make ...

Discover More

Dividing the Screen Unevenly between Two Workbooks

When working with multiple workbooks, you'll typically want to resize the workbook windows so you can see the data from each ...

Discover More

Do More in Less Time! Are you ready to harness the full power of Word 2013 to create professional documents? In this comprehensive guide you'll learn the skills and techniques for efficiently building the documents you need for your professional and your personal life. Check out Word 2013 In Depth today!

More WordTips (menu)

Sorting Tabular Tables

Some people like to format simple tables using tabs instead of using Word's table editor. When it comes time to sort such ...

Discover More

Sorting Dates Numerically

How you sort dates depends, in large part, on how they are formatted. This tip examines a very specific date format ...

Discover More

Changing Paragraph Order

Want a quick way to rearrange entire paragraphs of your document? You can easily do it by using the technique described here.

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. Maximum image size is 6Mpixels. 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 five minus 4?

2017-10-05 05:26:05

Eza Khar

Thank you very much! Very useful for me.


2015-09-24 09:31:14

Silver Doll

Beautiful. That's an useful tip.


2015-05-12 23:19:51

Su

Thank you very much. This made my recipes so much more easy to find in the table of contents!


2014-12-26 22:03:32

SDavis

Thanks so much for your help!


2014-08-11 04:25:19

Pali

thanks for helpful tip, it saved me a lot of work! great!


2014-07-08 12:10:34

Terry

Excellent! Only had one problem and that is my index got sorted in the mix. I just deleted it and reinserted it. I needed my Table of Contents in alpha order because it is a click through and this solved that problem. I did the sort then updated my Table of Contents and all is good. Thank you!!


2014-01-03 19:11:43

Buble Gum

Thank you for the tip. I was helpful, indeed.


2013-07-08 07:47:32

Sandra

Hi, I'm not sure if this will work for my problem.

I have 248 songs (one per page) in a word document.

I need to sort them alphabetically.

Any tips! Help!

Sandra


2013-06-07 03:00:12

Happy User

Fantastic Tip.. Thanks from Australia..!!!


2013-05-23 07:35:55

Joe

Great tip on sorting in word outline. I didn't know this was even possible. Thank you very for this tip.

Joe


2013-03-15 15:43:24

Jeff

Ok, there is a problem but I found the workaround. The problem is that I had a table of contents which Word 2010 considers a "field"

Even though that table of contents was not in the selection, word still couldn't sort it. Once I removed the table of contents, I could sort. Then, I reinserted the table of contents again.

Strange that Word's error message was cryptic and wrong ... table of contents is not what most people call a field but ... worse ... it wasn't in the selection!


2013-03-11 06:13:06

mr

thanks a lot!


2013-01-16 10:23:05

awyatt

Eileen,

There was no table menu option available because you are using Word 2007 or Word 2010, and this tip is for older versions of Word. (The give-away was that you mentioned the Home tab, which is only available in Word 2007 and Word 2010.)

To see the steps that *will* work for you, click the link at the end of the tip to see the steps that will work in later versions of Word.

-Allen


2013-01-16 10:18:38

Eileen

There was no table menu option available for me. I got it to work by doing the following:

-Put a pipe character (|) at the end of each page before a new heading. (You can use any character that doesn't occur in your document.)
-Follow the procedure above up to #4.
-Go to the Home tab and click on the Sort Ascending key.
-Set the conditions so that the pipe character is the sort key (Options button in the Sort Text dialog box); set the "Sort by" to Field 1.
-Click ok and it should sort correctly.
-Remove the pipe characters using Find and Replace.


2012-09-02 04:15:28

voja

I just have tried your recipe and it works brilliantly in Preview Word 2013. You saved me of tedious job of arranging over 900 pages. In a sec. I could not believe. Checked it over again, great relief. Very best regards, and thank you, again.
WU 0213.


2012-07-08 16:25:11

Analytical Guy

This worked. Thanks.

My experience was that it didn't work until I collapsed all the text underneath my H2 headings, but then it worked fine.


This Site

Got a version of Word that uses the menu interface (Word 97, Word 2000, Word 2002, or Word 2003)? This site is for you! If you use a later version of Word, visit our WordTips site focusing on the ribbon 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.