|
- Sub 统计()
- Dim d, da, ar, br, i, t
- Set d = CreateObject("Scripting.Dictionary")
- Set da = CreateObject("Scripting.Dictionary")
- [D2:E10000] = Empty
- ar = Sheet1.Range("A1").CurrentRegion
- br = Sheet2.Range("A1").CurrentRegion
- For i = 2 To UBound(br)
- d(br(i, 1) & br(i, 2)) = br(i, 3)
- Next
- For i = 2 To UBound(ar)
- da(ar(i, 1) & ar(i, 2)) = i
- Next
- t = da.items
- For i = 0 To da.Count - 1
- Cells(t(i), 4) = d(Cells(t(i), 1) & Cells(t(i), 2))
- If Cells(t(i), 4) <> "" Then
- If Cells(t(i), 3) >= "17:30" Then: Cells(t(i), 5) = "OK": Else: Cells(t(i), 5) = "NO"
- End If
- Next
- Set d = Nothing
- Set da = Nothing
- End Sub
复制代码 |
|