Results 1 to 9 of 9
  1. #1
    4 Star Lounger
    Join Date
    Mar 2002
    Location
    Sacramento, California, USA
    Posts
    509
    Thanks
    4
    Thanked 1 Time in 1 Post

    How to do case-sensitive sort in table?

    I'm trying to perform a case sensitive sort on a table, and Word 2010 is not cooperating.

    The table has two columns. I need to perform a case sensitive sort on the second column.

    The Sort dialog has an Options button which opens a Sort Options dialog, which has a "Case sensitive" check box. But after I check the box, the "Sort by" dropdown lists only column 1. (If I clear the box again, the dropdown still lists only column 1. But if I cancel and reopen the dialog, the dropdown lists column 2 again.)

    But it gets worse. I was able to perform a case sensitive sort by checking the box, sorting on column 1, reopening the dialog, and sorting on column 2. (I confirmed that the check box was still checked after the sort.) But it doesn't help; even with the check box checked, Word still does a case insensitive sort.

    I tried exchanging the columns. That eliminates the problem of how to select column 2, but Word still does a case insensitive sort.

    Excel 2010 has essentially the same problem.

    Does anyone know a fix or workaround for this?

  2. #2
    WS Lounge VIP mrjimphelps's Avatar
    Join Date
    Dec 2009
    Location
    USA
    Posts
    3,407
    Thanks
    447
    Thanked 405 Times in 377 Posts
    I have Word 2010. I created a table and then tried to do a sort. Column 1 was my only option.

    I exited the sort and tried again, and this time I saw all columns listed. The sort was case sensitive, and I verified that it worked correctly.

    Not sure why you can't get yours to work.

  3. #3
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts
    It seems to be Case Sensitive for me but I guess it depends on what you are expecting to get. I am getting an order of aAbBcC etc but you might be wanting either abcABC or ABCabc instead. In my mind, all three options could be considered a 'case sensitive sort'.

    If you need to have all the uppercase before all the lowercase or viceversa then you will probably need a macro to help out. You can find such a beast by Googling it.

    I agree the dialog is pretty ordinary in how adding the Case Sensitivity stops the option of the second column displaying but re-opening the dialog seems to solve that. Looking at the vba generated it appears you can't mix and match the Case Sensitivity (if it is on, its on for all columns).
    Last edited by Andrew Lockton; 2016-03-08 at 02:32. Reason: Fixed typos and had more to say
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  4. #4
    4 Star Lounger
    Join Date
    Mar 2002
    Location
    Sacramento, California, USA
    Posts
    509
    Thanks
    4
    Thanked 1 Time in 1 Post
    I don't think I understand what you mean by aAbBcC, etc. If aAbBcC means that A follows a, b follows A, etc. -- that is neither case sensitive nor case insensitive. I'd call it "almost case insensitive," or just "bizarre."

    By a "case sensitive sort," I mean a sort that respects the order of characters in the character set being used. Every Roman character set I know of uses the same order as ASCII for characters that are defined in ASCII. Thus all upper case letters precede all lower case letters, and all numerals precede both.

    I wanted to do this because I was prototyping a procedure that merges two lists, and one of the lists, not under my control, was sorted in case sensitive order. To merge the lists I had to sort the other list the same way. I've since coded and debugged the procedure, so the immediate need is past, but the same need is likely to come up again. I hope I can figure out how to do it before I need it.
    Last edited by jsachs177; 2016-03-10 at 00:15.

  5. #5
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts
    This looks like it will create a string/value for the strings that allows you to sort all the uppercase letters before lowercase letters
    https://msdn.microsoft.com/en-us/lib.../ff197656.aspx

    As I said, case sensitivity is in the eye of the beholder. IMO, the ASCII value of a character is just a different way of sorting strings and the alphabetical organisation of text was happening well before ASCII was invented. Does a dictionary have an uppercase section followed by a lowercase section? If not, does this mean that it doesn't display a Case Sensitive order? My Collins Dictionary chooses lowercase letters before uppercase (eg. arras then Arras) so as far as I'm concerned it does sort on both letters AND on case.
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  6. #6
    4 Star Lounger
    Join Date
    Mar 2002
    Location
    Sacramento, California, USA
    Posts
    509
    Thanks
    4
    Thanked 1 Time in 1 Post
    Andrew, I think you've gotten distracted from the problem, which is how to make Word (or Excel) sort a table according to the numeric values of the characters in a given column. I called that a case sensitive sort, but I really don't care what it's called; it's what I need.

    (It's also the most basic type of sort there is. Think of it as being like plain yogurt. If a store sells yogurt you may argue all you want about whether it ought to carry vanilla but not peach, or fruit-on-the-bottom but not fruit-mixed-in, but if it doesn't carry plain yogurt along with whatever else, that is truly peculiar.)

    My original question was: how can I make Word perform what I called a case sensitive sort? (You can call it a naive sort, or a Herzegovinian sort, if that makes you more comfortable.) It originally did not cross my mind that Word simply can't. I'm now entertaining that possibility, although I find it somewhat mind bending. If it proves to be so, my question becomes: what general purpose Windows-based tool for manipulating text and tables can perform this type of sort?

  7. #7
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts
    OK, out of the box NEITHER Word nor Excel can sort a list how you want it.

    But the macro I pointed you at can be used in Excel to add a column beside your list with a formula in that NEW column that can then be sorted in the order you want. If you pasted that function into an Excel module and then added a formula that used it: eg
    =StrToHex(A1)
    you can then autofill the rest of that column and sort on that column.

    You can do it easily in Excel with only THAT macro and a new column of data.

    If you want to combine that macro with another one to do the same in Word then you can also do it in Word.

    In both cases, once your sort has been performed, you can then delete the added column to get back to the result you wanted. It isn't as easy as clicking a single button but it is easier than picking the bits of fruit out of the yoghurt.
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  8. #8
    4 Star Lounger
    Join Date
    Mar 2002
    Location
    Sacramento, California, USA
    Posts
    509
    Thanks
    4
    Thanked 1 Time in 1 Post
    OK, it will work. It seems strange, though, to work so hard to avoid relatively advanced features when I don't want them. If I were looking for plain yogurt, I'd be stuck with a laboratory process for removing the fruit from fruit yogurt. I guess that's what I should expect from Microsoft, though...

  9. #9
    Banned Member
    Join Date
    Mar 2016
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I'm attempting to perform a case touchy sort on a table but It seems to be Case Sensitive for me..

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •