哈哈,用if方式更快啦! Sub aa() t1 = Timer Application.ScreenUpdating = False Dim rng, arr(1 To 60000, 1 To 1) rng = [a1:j60000] For i = 1 To 60000 If rng(i, 1) <> "" Then arr(i, 1) = i ElseIf rng(i, 2) <> "" Then arr(i, 1) = i ElseIf rng(i, 3) <> "" Then arr(i, 1) = i ElseIf rng(i, 4) <> "" Then arr(i, 1) = i ElseIf rng(i, 5) <> "" Then arr(i, 1) = i ElseIf rng(i, 6) <> "" Then arr(i, 1) = i ElseIf rng(i, 7) <> "" Then arr(i, 1) = i ElseIf rng(i, 8) <> "" Then arr(i, 1) = i ElseIf rng(i, 9) <> "" Then arr(i, 1) = i ElseIf rng(i, 10) <> "" Then arr(i, 1) = i End If Next [k1:k60000] = arr [a1:k60000].Sort Key1:=Range("k1") [k1:k60000] = "" Application.ScreenUpdating = True MsgBox Timer - t1 End Sub |