📜  vba 对多列进行排序 - VBA 代码示例

📅  最后修改于: 2022-03-11 14:51:56.444000             🧑  作者: Mango

代码示例1
' Sorts a range with multiple criterias
Sub MultipleColumnsSort()
    With ActiveSheet.Sort
         .SetRange Range("A1:D10")
         .SortFields.Add Key:=Range("A1"), Order:=xlAscending
         .SortFields.Add Key:=Range("B1"), Order:=xlDescending
         ' If range includes headers
         .Header = xlYes
         .Apply
    End With
End Sub