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
-
Windows 11 Insider Preview build 26200.5603 released to DEV
by
joep517
2 hours, 35 minutes ago -
Windows 11 Insider Preview build 26120.4151 (24H2) released to BETA
by
joep517
2 hours, 37 minutes ago -
Fixing Windows 24H2 failed KB5058411 install
by
Alex5723
5 hours, 47 minutes ago -
Out of band for Windows 10
by
Susan Bradley
7 hours, 20 minutes ago -
Giving UniGetUi a test run.
by
RetiredGeek
14 hours, 17 minutes ago -
Windows 11 Insider Preview Build 26100.4188 (24H2) released to Release Preview
by
joep517
21 hours, 55 minutes ago -
Microsoft is now putting quantum encryption in Windows builds
by
Alex5723
19 hours, 53 minutes ago -
Auto Time Zone Adjustment
by
wadeer
1 day, 2 hours ago -
To download Win 11 Pro 23H2 ISO.
by
Eddieloh
1 day ago -
Manage your browsing experience with Edge
by
Mary Branscombe
4 hours, 39 minutes ago -
Fewer vulnerabilities, larger updates
by
Susan Bradley
15 hours, 35 minutes ago -
Hobbies — There’s free software for that!
by
Deanna McElveen
19 hours, 52 minutes ago -
Apps included with macOS
by
Will Fastie
19 hours, 30 minutes ago -
Xfinity home internet
by
MrJimPhelps
19 hours, 25 minutes ago -
Convert PowerPoint presentation to Impress
by
RetiredGeek
19 hours, 23 minutes ago -
Debian 12.11 released
by
Alex5723
1 day, 23 hours ago -
Microsoft: Troubleshoot problems updating Windows
by
Alex5723
2 days, 3 hours ago -
Woman Files for Divorce After ChatGPT “Reads” Husband’s Coffee Cup
by
Alex5723
1 day, 6 hours ago -
Moving fwd, Win 11 Pro,, which is best? Lenovo refurb
by
Deo
23 hours, 4 minutes ago -
DBOS Advanced Network Analysis
by
Kathy Stevens
2 days, 20 hours ago -
Microsoft Edge Launching Automatically?
by
healeyinpa
2 days, 10 hours ago -
Google Chrome to block admin-level browser launches for better security
by
Alex5723
8 hours, 16 minutes ago -
iPhone SE2 Stolen Device Protection
by
Rick Corbett
2 days, 15 hours ago -
Some advice for managing my wireless internet gateway
by
LHiggins
1 day, 22 hours ago -
NO POWER IN KEYBOARD OR MOUSE
by
HE48AEEXX77WEN4Edbtm
1 day ago -
A CVE-MITRE-CISA-CNA Extravaganza
by
Nibbled To Death By Ducks
3 days, 8 hours ago -
Sometimes I wonder about these bots
by
Susan Bradley
20 hours, 24 minutes ago -
Does windows update component store “self heal”?
by
Mike Cross
2 days, 18 hours ago -
Windows 11 Insider Preview build 27858 released to Canary
by
joep517
3 days, 22 hours ago -
Pwn2Own Berlin 2025: Day One Results
by
Alex5723
2 days, 6 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.