- Sub gj23w98()
- Set d = CreateObject("Scripting.Dictionary")
- Set d1 = CreateObject("Scripting.Dictionary")
- Set d2 = CreateObject("Scripting.Dictionary")
- arr = Sheet2.[a1].CurrentRegion
- For i = 2 To UBound(arr)
- s = arr(i, 1) & arr(i, 2)
- d(s) = arr(i, 3)
- d1(s) = arr(i, 4)
- d2(s) = arr(i, 5)
- Next
- brr = [a1].CurrentRegion
- For i = 2 To UBound(brr)
- s = brr(i, 3) & brr(i, 5)
- If brr(i, 1) >= arr(1, 3) And brr(i, 1) <= arr(1, 4) Then
- brr(i, 7) = d(s)
- ElseIf brr(i, 1) >= arr(1, 4) And brr(i, 1) <= arr(1, 5) Then
- brr(i, 7) = d1(s)
- ElseIf brr(i, 1) >= arr(1, 5) Then
- brr(i, 7) = d2(s)
- End If
- brr(i, 8) = brr(i, 6) * brr(i, 7)
- Next
- [a1].CurrentRegion = brr
- End Sub
复制代码 |