|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
Sub try()
Dim arr
Dim dic
Set dic = CreateObject("scripting.dictionary")
arr = Sheets("明细").UsedRange
For i = 2 To UBound(arr)
s = arr(i, 4) & arr(i, 6)
s1 = arr(i, 10) & arr(i, 6)
If Not dic.exists(s) Then
dic(s) = arr(i, 2)
End If
If Not dic.exists(s1) Then
dic(s1) = arr(i, 2)
End If
Next i
For i = 2 To Sheets("延误占比").Range("a65536").End(xlUp).Row
s2 = Sheets("延误占比").Range("a" & i) & Sheets("延误占比").Range("b" & i)
s3 = Sheets("延误占比").Range("a" & i - 1) & Sheets("延误占比").Range("b" & i)
If Sheets("延误占比").Range("a" & i) <> "" Then
Sheets("延误占比").Range("c" & i) = dic(s2)
Else
Sheets("延误占比").Range("c" & i) = dic(s3)
End If
If Sheets("延误占比").Range("c" & i) = "" Then
Sheets("延误占比").Range("c" & i) = "达标"
End If
Next i
End Sub |
评分
-
1
查看全部评分
-
|