|
- Sub ykcbf() '//2025.3.26 排序
- Application.ScreenUpdating = False
- Application.DisplayAlerts = False
- On Error Resume Next
- Dim tm: tm = Timer
- Set Sh = ThisWorkbook.Sheets("Sheet1")
- With Sh
- r = .Cells(.Rows.Count, 7).End(3).Row
- Set Rng = .Range("a2:h" & r)
- arr = Rng.Value
- For i = 1 To UBound(arr)
- arr(i, 8) = 1
- tt = Val(ston(arr(i, 3)))
- If tt > 0 Then arr(i, 8) = 9
- Next
- End With
- Set sht = ThisWorkbook.Worksheets.Add
- With sht
- Set Rng = .[a1].Resize(UBound(arr), UBound(arr, 2))
- Rng.Value = arr
- Rng.Sort Rng.Columns(8), 1, Orientation:=1
- arr = .Range("a2:g" & r).Value
- End With
- sht.Delete
- Sh.[a2].Resize(UBound(arr), UBound(arr, 2)) = arr
- Application.ScreenUpdating = True
- MsgBox "共用时:" & Format(Timer - tm, "0.000") & "秒!"
- End Sub
复制代码
|
|