Skip to content
本页内容

SortMethod (属性)

指定中文排序方法。可读/写 XlSortMethod 类型。

说明

XlSortMethod 可以是以下 SortMethod 常量之一:
xlStroke
xlPinYin

示例

python
#本示例设置第一张工作表按字符的汉语拼音顺序排序
def test():
    Application.Sheets.Item(1).Sort.SortMethod = xlPinYin
python
#本示例判断活动工作表排序时执行的排序类型,并通知用户
def test():
    if Application.ActiveSheet.Sort.SortMethod == xlPinYin:
        print("执行按字符的汉语拼音顺序排序")
    elif Application.ActiveSheet.Sort.SortMethod == xlStroke:
        print("执行按每个字符的笔划数排序")