@xzk235将字典赋值给数组然后循环会稍微快一点,按你的模块3改了改,(主要就是把字典赋值给数组)不过还是没达到要求。
Sub paiming1()
Dim t
t = Timer
'Application.ScreenUpdating = False
Dim x&, d As Object, i&, j&, sj, zz, qd%, yy, dat, arr1, r&, arr, rr%
Set d = CreateObject("Scripting.Dictionary")
x = [c10000].End(xlUp).Row
ReDim arr(1 To x - 1, 1 To 1)
dat = Range("a2:c" & x).Value
r = x - 1
For i = x - 1 To 1 Step -1
d(dat(i, 3)) = ""
If dat(i, 1) <> "" Then
arr1 = d.keys
For zz = r To i Step -1
rr = 1
For yy = 0 To UBound(arr1)
If dat(zz, 3) < arr1(yy) Then rr = rr + 1
Next
arr(zz, 1) = rr
Next
r = i - 1
d.RemoveAll
End If
Next
Range("d2:d" & x) = arr
'Application.ScreenUpdating = True
Range("g16") = Timer - t
End Sub