Sub test2()
Dim r%, i%
With Worksheets("sheet2")
r = .Cells(.Rows.Count, 1).End(xlUp).Row
.Sort.SortFields.Clear
.Sort.SortFields.Add Key:=.Range("A1:E1"), SortOn:=xlSortOnValues, Order:=xlAscending, CustomOrder:="工作组,性别,姓名,年龄,地址", DataOption:=xlSortNormal
With .Sort
.SetRange Range("A1:E" & r)
.Header = xlYes
.MatchCase = False
.Orientation = xlLeftToRight
.SortMethod = xlPinYin
.Apply
End With
End With
End Sub
使用vba实现excel 列的快速排序
最新推荐文章于 2025-04-09 22:30:44 发布