|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
'序号137 没有匹配到,所以差了12
'14614.4 12
Option Explicit
Sub test()
Dim arr, brr, i, j, dic
Set dic = CreateObject("scripting.dictionary")
arr = Sheets("段落").[a1].CurrentRegion
brr = Sheets("植树").[a17].CurrentRegion
ReDim crr(1 To UBound(arr, 1) - 6, 1 To 1)
For i = 7 To UBound(arr, 1)
For j = 1 To UBound(brr, 1)
If brr(j, 2) >= arr(i, 2) And brr(j, 2) < arr(i, 3) And _
arr(i, 4) = brr(j, 4) Then
crr(i - 6, 1) = crr(i - 6, 1) + brr(j, 3)
dic(brr(j, 2)) = brr(j, 3)
End If
Next
Next
Sheets("段落").[e7].Resize(UBound(crr, 1)) = crr
For i = i To UBound(brr, 1)
If Not dic.exists(brr(i, 2)) And brr(i, 3) > 0 Then _
Debug.Print brr(i, 1), brr(i, 2), brr(i, 3)
Next
End Sub |
评分
-
2
查看全部评分
-
|