短信收到,我阅读困难,只看懂一点点,先从6列中的最后一列(备注)开始吧:
Sub Macro1()
Dim d As Object, arr, brr, crr(), i&, r&
Set d = CreateObject("scripting.dictionary")
arr = Sheets("考核标准").Range("A1").CurrentRegion
For i = 3 To UBound(arr)
d(arr(i, 1)) = i
Next
brr = Range("C3:E" & Range("C65536").End(xlUp).Row)
ReDim crr(1 To UBound(brr), 1 To 6)
For i = 1 To UBound(brr)
If d.Exists(brr(i, 1)) Then
r = d(brr(i, 1))
If brr(i, 2) >= arr(r, 2) Then
If brr(i, 2) >= Val(arr(r - 2, 3)) And brr(i, 3) >= Val(arr(r - 2, 4)) Then
If r >= 6 Then
crr(i, 6) = "晋升两级"
Else
crr(i, 6) = "维持"
End If
ElseIf brr(i, 2) >= Val(arr(r - 1, 3)) And brr(i, 3) >= Val(arr(r - 1, 4)) Then
If r >= 5 Then
crr(i, 6) = "晋升一级"
Else
crr(i, 6) = "维持"
End If
Else
crr(i, 6) = "维持待晋"
End If
Else
crr(i, 6) = "待维持"
End If
End If
Next
Range("f3").Resize(i - 1, 6) = crr
End Sub |