I have tables containing numbered requirements that need to be sorted numerically (ascending). The requirement numbers are cross-references to the paragraph numbers of bookmarks. For a few days I swear Word 2000 was sorting the numbers perfectly, then all of a sudden it started giving strange results.
I have attached a sample document. In the table. I would like the requirements to be ordered:
1.1
1.1.1.1
1.1.1.1.1
1.1.2
1.1.3
1.1.10
I thought this would be the result I would get from a “Number, Ascending” sort on the column. As Table 1 in the attached file shows, this is not how Word sorts it.
In Table 2, I simply keyed in the same numbers from Table 1, so that they are no longer cross-references to bookmark paragraph numbers. Word also sorts this table incorrectly (“Number, Ascending” option again), although the result is not the same as the one it gave in Table 1.
Does anyone know what’s going on, and whether it’s possible to numerically sort a table based on a column containing cross-references to bookmark paragaraph numbers?
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
-
Table sort problems (2000/SR1)
Home » Forums » AskWoody support » Productivity software by function » MS Word and word processing help » Table sort problems (2000/SR1)
- This topic has 14 replies, 3 voices, and was last updated 20 years, 1 month ago.
AuthorTopicWSgeoric1
AskWoody LoungerApril 14, 2005 at 5:58 pm #418309Viewing 0 reply threadsAuthorReplies-
Andrew Lockton
AskWoody_MVPApril 15, 2005 at 4:59 am #941069(Edited by Andrew Lockton on 15-Apr-05 15:59. Must investigate assumptions before shooting mouth off.)
This is standard behaviour. All the office products sort these series of strings as Strings (alphabetically) rather than Numbers like you would like. This is pretty reasonable (albeit annoying) since traditional numbers don’t have multiple decimal points.
The way around this is usually to pad the numbering with leading zeros so that the numbers appear like this.
1.01
1.01.01.01
1.01.01.01.01
1.01.02
1.01.03
1.01.10This is not possible with Word’s autonumbering though {Wrong Assumption – see Stuart’s post} so you have to come up with VBA code which takes the table you want to sort and
1. Adds a temporary column to the table
2. Populates this column with the numbered column padded with zeros
3. Sorts the table on the temp column
4. Deletes the temp column.
The code to pad the numbering has been posted in Access and Excel forums in the past – usually for sorting WBS (Work Breakdown Structures). Adapting such code would provide you with a workable solution.Thinking laterally, it is probably easier to create the table you want in another way that is less problematic and less labour intensive to create and maintain the cross-referencing table too. Do you actually have requirement numbers displayed in your doc or are you just using the paragraph numbering and choosing which paragraphs contain a requirement? If so, perhaps each requirement number could use a character style to make it stand out (or keep it hidden). A macro could easily create TOC entries for each of these entries and then you could build a TOC of requirement numbers which automatically creates the list in the correct order.
-
WSStuartR
AskWoody LoungerApril 15, 2005 at 4:35 am #941084> This is not possible with Word’s autonumbering though
This can be done with heading numbering, see post 327334 for an example.
StuartR
-
Andrew Lockton
AskWoody_MVPApril 15, 2005 at 4:56 am #941085Good catch Stuart – I didn’t bother checking that first and have been caught out. That should give the original poster a simpler solution if the cross-reference table is already built and the document will not be heavily modified in the future.
I would still recommend investigating the suggested TOC method though because creating and updating a TOC is a whole lot easier than trying to build and maintain a list of cross-references to numbered paragraphs which contain requirements.
-
WSStuartR
AskWoody LoungerApril 15, 2005 at 5:01 am #941087Andrew,
I spent a bit of time last night trying to do this with a TOC, but I wasn’t successful. I was trying to use Style Separators between the Heading numbers and the heading text, but couldn’t get the behaviour I wanted. I think you’re right that this could be made to work, and I would love to see the solution.
StuartR
-
Andrew Lockton
AskWoody_MVPApril 15, 2005 at 5:18 am #941090I tried Character styles first but I couldn’t build a TOC on character styles unless it was applied to the entire paragraph. The Style Separator may not work for this user as he quoted Word 2000 SR1 as his version.
Knowing how requirements are usually listed (may be more than one requirement inside one paragraph) I would guess that this may not be doable with styles alone anyway.
Without seeing the real file being used, and assuming that the poster has already done the labour intensive part of constructing this crossref table then I think the padded heading numbers should give them a relatively painless quick fix.
-
Andrew Lockton
AskWoody_MVPApril 15, 2005 at 5:35 am #941093Attached is a rework of the original file showing how it could be done with TC fields. If the tagging was automated then this would be a simple document to maintain into the future. I don’t think that the macro would need to be very complex but it would be easier if there was something consistent to mark out what exactly is a requirement number.
-
WSStuartR
AskWoody Lounger -
WSgeoric1
AskWoody LoungerApril 15, 2005 at 4:20 pm #941231Stuart / Andrew:
Thanks to both of you for your input. I just met with the tech writer of the document.
Stuart, padding the requirement numbers with leading zeroes is not an option. The tabled requirements are taken from ReqPro and no changes to the numbering are acceptable. I’m assuming there is no way to use your method and somehow hide the zeroes.
Andrew, I can see that you added a TOC which orders the numbers correctly, but I don’t see how you used TC fields to do so. Also, I don’t see how I could integrate such a TOC into the actual table, which has 6 columns (my sample doc only included a small example of column 1). The way I understand how your method would work is that I would overwrite my column 1 with the results of the TOC. But if I did so, wouldn’t all the data in the remaining columns be mismatched to what’s in column 1? For example, column 2 includes cross-refs to all the bookmark texts.
Also, no one has commented on why the two tables in my attachment produced different results when sorted in identical ways. -
WSStuartR
AskWoody LoungerApril 15, 2005 at 5:06 pm #941237I don’t understand the different sort order in your two original tables.
The only remaining solution I can think of is to write a Macro to generate the exact data you want in the order you want it sorted, and to bookmark the table column so you can delete the cell contents and regenerate them when needed.
StuartR
-
Andrew Lockton
AskWoody_MVPApril 16, 2005 at 12:16 am #941315(Edited by Andrew Lockton on 16-Apr-05 11:16. Tested the sorting further)
The TC fields are hidden text – you need to reveal hidden text to see them.
If there is other stuff in the table then the TC method isn’t going to be useful but there are still different options to investigate to get this table sorted:
1. Get ReqPro to put them in the right order since it built the table in the first place
2. Change the autonumbering to pad the digits, update the cross-refs, sort the table, change the autonumbering back to the original pattern
3. Copy the entire table to Excel, add a column which contains a formula to pad the digits, paste this extra column back into Word, sort on this column and then delete it
4. Write a macro to do the same as option 3 but staying in Word
5. Get the techwriter to do itThe tables both sort the same way for me – perhaps you used different sorting methods with them (text vs date vs Numbers) – they give different results.
Hang on – when I sort the table as text or dates then two tables give the same result but not when I sort as numbers. I have no idea why this doesn’t give the same sorting result. -
WSgeoric1
AskWoody Lounger -
WSStuartR
AskWoody LoungerApril 16, 2005 at 5:47 am #941344I had another look at your two original tables, trying to understand the sort order.
It isn’t actually sorting the two tables differently. What it is doing (that I still don’t understand) is sorting 1.1.1.1.1 and 1.1.3 to exactly the same place. These two entries remain in the same order as they started before the sort. If you move either of them to the top of the table and resort then it will remain above the other at the end of the sort!
Both tables behave exactly the same, the only difference is that one of them happened to have these two entries in a different order to the other before the sort started.
StuartR
-
WSgeoric1
AskWoody LoungerApril 18, 2005 at 1:27 pm #941714Stuart,
My table sort isn’t performing that way. The 1.1.1.1.1 and 1.3 entries are not staying in the same place. Maybe it has something to do with the version of Word.
We’ll simply have to consider this to be another interesting undocumented Word feature. Thanks again for looking into this for me. -
WSStuartR
AskWoody Lounger
-
-
-
-
Viewing 0 reply threads -

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
Installer program can’t read my registry
by
Peobody
5 hours, 32 minutes ago -
How to keep Outlook (new) in off position for Windows 11
by
EspressoWillie
7 hours, 41 minutes ago -
Intel : CVE-2024-45332, CVE-2024-43420, CVE-2025-20623
by
Alex5723
5 hours, 25 minutes ago -
False error message from eMClient
by
WSSebastian42
5 hours, 20 minutes ago -
Awoke to a rebooted Mac (crashed?)
by
rebop2020
14 hours, 24 minutes ago -
Office 2021 Perpetual for Mac
by
rebop2020
15 hours, 37 minutes ago -
AutoSave is for Microsoft, not for you
by
Will Fastie
24 minutes ago -
Difface : Reconstruction of 3D Human Facial Images from DNA Sequence
by
Alex5723
19 hours, 8 minutes ago -
Seven things we learned from WhatsApp vs. NSO Group spyware lawsuit
by
Alex5723
5 hours, 9 minutes ago -
Outdated Laptop
by
jdamkeene
1 day ago -
Updating Keepass2Android
by
CBFPD-Chief115
1 day, 5 hours ago -
Another big Microsoft layoff
by
Charlie
1 day, 5 hours ago -
PowerShell to detect NPU – Testers Needed
by
RetiredGeek
9 hours, 4 minutes ago -
May 2025 updates are out
by
Susan Bradley
4 hours, 58 minutes ago -
Windows 11 Insider Preview build 26200.5600 released to DEV
by
joep517
1 day, 11 hours ago -
Windows 11 Insider Preview build 26120.3964 (24H2) released to BETA
by
joep517
1 day, 11 hours ago -
Drivers suggested via Windows Update
by
Tex265
1 day, 11 hours ago -
Thunderbird release notes for 128 esr have disappeared
by
EricB
1 day, 9 hours ago -
CISA mutes own website, shifts routine cyber alerts to X, RSS, email
by
Nibbled To Death By Ducks
1 day, 18 hours ago -
Apple releases 18.5
by
Susan Bradley
1 day, 13 hours ago -
Fedora Linux 40 will go end of life for updates and support on 2025-05-13.
by
Alex5723
1 day, 20 hours ago -
How a new type of AI is helping police skirt facial recognition bans
by
Alex5723
1 day, 20 hours ago -
Windows 7 ISO /Windows 10 ISO
by
ECWS
5 hours, 2 minutes ago -
No HP software folders
by
fpefpe
2 days, 4 hours ago -
Which antivirus apps and VPNs are the most secure in 2025?
by
B. Livingston
1 day, 1 hour ago -
Stay connected anywhere
by
Peter Deegan
2 days, 9 hours ago -
Copilot, under the table
by
Will Fastie
12 hours, 7 minutes ago -
The Windows experience
by
Will Fastie
2 days, 15 hours ago -
A tale of two operating systems
by
Susan Bradley
20 hours, 10 minutes ago -
Microsoft : Resolving Blue Screen errors in Windows
by
Alex5723
2 days, 21 hours ago
Recent blog posts
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.