老师你好,按照你提供的思路已完成了大部分的代码编写,还有4列无法编写或代码不生效,麻烦你看看,指导一下:
N列公式:=IF(H3="不参评","不参评",SUMPRODUCT((E:E=E3)*(H:H=H3)*(J:J>J3))+1)转化
If crr(dic(drr(i, 1) & "|" & drr(i, 2)), 8) = "不参评" Then
crr(dic(drr(i, 1) & "|" & drr(i, 2)), 14) = "不参评"
ElseIf crr(dic(drr(i, 1) & "|" & drr(i, 2)), 5) = crr(dic(drr(i, 1) & "|" & drr(i, 2)), 5) And crr(dic(drr(i, 1) & "|" & drr(i, 2)), 8) = "参评" And crr(dic(drr(i, 1) & "|" & drr(i, 2)), 10) > crr(dic(drr(i, 1) & "|" & drr(i, 2)), 10) Then
crr(dic(drr(i, 1) & "|" & drr(i, 2)), 14) = n + 1
End If
O列公式:=IFERROR(IF(M3<0.3,-7.5,IF(M3<0.4,-6,IF(M3<0.5,-5,IF(M3<0.6,-4,IF(M3<0.7,-3,IF(M3<0.8,-2,IF(M3<0.9,-1,IF(L3>=1,VLOOKUP(N3,表5分值分布!J:M,IF(E3="值班站长",2,IF(E3="值班员",3,IF(E3="站务员",4,""))),0),0)))))))),"")转化
drr = Sheets(5).UsedRange
For i = 2 To UBound(drr)
If dic.exists(drr(i, 1) & "|" & drr(i, 2)) Then
crr(dic(drr(i, 1) & "|" & drr(i, 2)), 14) = drr(i, 10)
If crr(dic(drr(i, 1) & "|" & drr(i, 2)), 13) < 0.3 Then
crr(dic(drr(i, 1) & "|" & drr(i, 2)), 15) = -7.5
ElseIf crr(dic(drr(i, 1) & "|" & drr(i, 2)), 13) < 0.4 Then
crr(dic(drr(i, 1) & "|" & drr(i, 2)), 15) = -6
ElseIf crr(dic(drr(i, 1) & "|" & drr(i, 2)), 13) < 0.5 Then
crr(dic(drr(i, 1) & "|" & drr(i, 2)), 15) = -5
ElseIf crr(dic(drr(i, 1) & "|" & drr(i, 2)), 13) < 0.6 Then
crr(dic(drr(i, 1) & "|" & drr(i, 2)), 15) = -4
ElseIf crr(dic(drr(i, 1) & "|" & drr(i, 2)), 13) < 0.7 Then
crr(dic(drr(i, 1) & "|" & drr(i, 2)), 15) = -3
ElseIf crr(dic(drr(i, 1) & "|" & drr(i, 2)), 13) < 0.8 Then
crr(dic(drr(i, 1) & "|" & drr(i, 2)), 15) = -2
ElseIf crr(dic(drr(i, 1) & "|" & drr(i, 2)), 13) < 0.9 Then
crr(dic(drr(i, 1) & "|" & drr(i, 2)), 15) = -1
ElseIf crr(dic(drr(i, 1) & "|" & drr(i, 2)), 12) >= 1 And crr(dic(drr(i, 1) & "|" & drr(i, 2)), 5) = "值班站长" Then
crr(dic(drr(i, 1) & "|" & drr(i, 2)), 15) = drr(i, 11)
ElseIf crr(dic(drr(i, 1) & "|" & drr(i, 2)), 12) >= 1 And crr(dic(drr(i, 1) & "|" & drr(i, 2)), 5) = "值班员" Then
crr(dic(drr(i, 1) & "|" & drr(i, 2)), 15) = drr(i, 12)
ElseIf crr(dic(drr(i, 1) & "|" & drr(i, 2)), 12) >= 1 And crr(dic(drr(i, 1) & "|" & drr(i, 2)), 5) = "站务员" Then
crr(dic(drr(i, 1) & "|" & drr(i, 2)), 15) = drr(i, 13)
End If
End If
Next
以上两列运行时没有报错但也没有成功显示数据,我无法找出原因所在。
U列公式:{=SUMPRODUCT((E:E=E3)*(T:T>T3))+1}
数组公式不清楚如何转换
V列公式:=IFERROR(IF(H4="不参评","不参评",IF(M4<0.7,"D",IF(F4>5,"C",VLOOKUP(U4,表6分配AB档指标!$R:$U,IF(E4="值班站长",2,IF(E4="值班员",3,IF(E4="站务员",4,0))),0)))),"")
这个与O列有些类似,不懂得VBA要如何表达。
|