|
分块排序。。。- Sub ykcbf() '//2024.7.29 排序
- Application.ScreenUpdating = False
- Set d = CreateObject("Scripting.Dictionary")
- With Sheets("成绩表")
- r = .Cells.SpecialCells(xlCellTypeLastCell).Row
- arr = .[a1].Resize(r, 9)
- For i = 1 To r
- If InStr(arr(i, 1), "名次") Then k = k + 1: d(k) = i
- Next
- For k = 1 To d.Count
- r1 = d(k)
- If k = d.Count Then r2 = r Else r2 = d(k + 1) - 2
- Set Rng = .Cells(r1 + 1, 1).Resize(r2 - r1, 9)
- Rng.Sort .Cells(r1 + 1, 1), 1
- Next
- End With
- Set d = Nothing
- Application.ScreenUpdating = True
- MsgBox "OK!"
- End Sub
复制代码
|
|