- Sub 备份1()
- Dim d, arr, brr, i&, j&, rend&
- rend = Range("B65536").End(3).Row
- arr = Range("B3:R" & rend)
-
- brr = Range("S3:X" & rend)
- Set d = CreateObject("scripting.dictionary")
- For i = 1 To UBound(arr)
- d(arr(i, 1)) = i
- Next
- For i = 1 To UBound(brr)
- j = d(brr(i, 1))
- brr(i, 2) = arr(i, 12) / arr(j, 17)
- brr(i, 3) = IIf(arr(i, 10) = "是", "", arr(i, 13) / arr(j, 17))
- brr(i, 4) = IIf(arr(i, 10) = "是", "", arr(i, 14) / arr(j, 17))
- brr(i, 5) = IIf(arr(i, 10) = "是", "", arr(i, 15) / arr(j, 17))
- brr(i, 6) = IIf(arr(i, 10) = "是", "", arr(i, 16) / arr(j, 17))
- Next
- Range("S3:X" & rend) = brr
- Erase arr, brr
- Set d = Nothing
- End Sub
复制代码 |