|
- Sub test()
- Dim r%, i%
- Dim arr, brr
- Dim rng As Range
- With Worksheets("报名信息")
- .AutoFilterMode = False
- r = .Cells(.Rows.Count, 1).End(xlUp).Row
- .Range("a4:t" & r).Sort key1:=.Range("c4"), order1:=xlAscending, Header:=xlNo
- Set rng = .Columns(3).Find(what:="女", LookIn:=xlValues, lookat:=xlWhole, searchorder:=xlByColumns, searchdirection:=xlNext)
- If rng Is Nothing Then
- .Range("a4:t" & r).Sort key1:=.Range("p4"), order1:=xlDescending, Header:=xlNo
- Else
- r0 = rng.Row
- .Range("a4:t" & r0 - 1).Sort key1:=.Range("p4"), order1:=xlDescending, Header:=xlNo
- .Range(.Cells(r0, 1), .Cells(r, 20)).Sort key1:=.Cells(r0, 16), order1:=xlAscending, Header:=xlNo
- End If
- End With
- End Sub
复制代码 |
|