ALPHABETIZE A NUMBERED LIST

S

spondee

I HAVE A LIST THAT IS NUMBERED AND I WOULD LIKE TO ALPHABETIZE THE LIST BUT
KEEP THE SAME NUMBERS WITH EACH ENTRY. IN OTHER WORDS I DO NOT WANT THE LIST
TO BE RENUMBERED. IE. 1. TOM , 2. ZANE 3. ANN SHOW BECOME 3. ANN, 1. TOM, 3.
ZANE.
 
S

StevenM

Spondee,

You'll want to place your list in a two-column table with the numbers in one
column and the names in the other column. Word will then be able to sort your
table according to column 2 alphabetically, keeping the numbers with the
names.

A little more difficult is knowing the best way to convert your list into a
table, but with a little imagination & knowledge it can be accomplished. For
example, say your list was formatted as:

1. Tom , 2. Zane, 3. Ann

You could (1) select the text. (2) Do a Find & Replace, where in the find
field one puts a period followed by a space (". ") and in the replace field
one puts a period followed by a comma and a space ("., "). (3) Then you could
convert the selected text into a table with two columns and using the comma
as the "separate text at" character. (4) Then sort your new table according
to the second column.

And if you don't want to keep the text in a table, you can convert the table
(after it has been sorted) back to text.

Steven Craig Miller
 
S

Suzanne S. Barnhill

The issue here is that if auto numbering has been used, the sorted list will
be renumbered. The workaround for this is to convert the numbers to text
before sorting. To do this, select the text, then press Alt+F11 to open the
VBA Editor and Ctrl+G to get to the Immediate window. In that window, type
ActiveDocument.ConvertNumbersToText
and press Enter.

Note that if the numbering is part of the style, it will be restored if the
style is reapplied, so it may be necessary to apply an unnumbered style.

It may be possible to sort the converted text according to Word 2 or some
other way so that it's not sorted numerically, but it may be necessary to
convert it to a table first (as you describe) and then sort.
 
S

StevenM

To: Suzanne S. Barnhill,

That is so cool! I didn't know that one could do that! As ever, I'm
impressed with the depth of your knowledge.

Steven Craig Miller
 
S

StevenM

To: Spondee,

If you are converting an autoNumbered list, after you follow Suzanne S.
Barnhill's suggestion, the character after the number & period is a tab
character. Thus converting this text to a table is even simpler than my
previous instructions. Just convert the selected text to a table using the
tab as separator (click "tab" under "Seperate text at").

Steven Craig Miller
 
S

Suzanne S. Barnhill

Well, not the depth of *my* knowledge in this case since I'm a total babe in
the woods when it comes to VBA, but the snippet I quoted is one that is
frequently posted in these NGs in answer to similar questions.
 

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