📅  最后修改于: 2022-03-11 14:51:56.444000             🧑  作者: Mango
' 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