Skip to content
本页内容

SortFields (属性)

可用来在工作簿、列表和自动筛选上存储排序状态。只读 SortFields类型。

示例

python
#本示例在活动工作表创建新的排序字段
def test():
    Application.ActiveSheet.Sort.SortFields.Add(Range("B1:B10"))
python
#本示例在第一张工作表添加两个排序字段,并显示排序字段集合的数量
def test():
    sortfields = Application.Sheets.Item(1).Sort.SortFields
    sortfields.Add(Range("A1:A5"))
    sortfields.Add(Range("B1:B5"))
    print(sortfields.Count)