Sorting Traditional Chinese Characters differs from 2003 and 2013

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • relicx2004
    New Member
    • May 2014
    • 9

    Sorting Traditional Chinese Characters differs from 2003 and 2013

    I created a VBA code to automatically sort(ascending order) a column containing Traditional Chinese characters on Excel 2003. It works well but when I tried running the code on a Excel 2013 version the sorted values differs versus on the sorted values on the Office 2003. I tried using
    Code:
    Range("A2:A30").SortSpecial SortMethod:=xlPinYin
    and
    Code:
    Range("D182:D187").SortSpecial SortMethod:=xlStroke
    but still the values are not sorted correctly.

    Am I out of luck on solving this issue?

    Any help is well appreciated.

    Thanks.
  • zmbd
    Recognized Expert Moderator Expert
    • Mar 2012
    • 5501

    #2
    Sorry, I don't know Chinese nor how it is that want it sorted; however, for those that are not familiar with the special sort options:

    NamedRange.Sort Method (read more)
    SortMethodType: Microsoft.Offic e.Interop.Excel .XlSortMethod
    The type of sort. Some of these constants may not be available to you, depending on the language support (U.S. English, for example) that you have selected or installed.

    Can be one of the following XlSortMethod values:

    xlStroke. Sorting by the quantity of strokes in each character.

    xlPinYin. Phonetic Chinese sort order for characters.
    Have you tried setting the other parameters, something like?

    Code:
    '<<<THIS IS AIR CODE... THE SYNTAX MAY NOT BE CORRECT>>>
    With ActiveWorkbook.Worksheets("GenericWorkSheetName").Sort
        .SetRange ActiveCell.Offset(-1, 0).Range("A3:R" & LR)
        .Header = xlGuess
        .MatchCase = False
        .Orientation = xlTopToBottom
        .SortMethod = xlPinYin
        .Apply
    End With
    Line 4 has other options, I used the guess here as a generic option (Range.Sort Method (Excel2013) - this is a little different link from MS than the first one. :) )

    It is a only a best guess and may not be the solution; however, we only have the two snippets of your code. :)
    Last edited by zmbd; May 7 '16, 03:55 PM.

    Comment

    Working...