|
……对了,请不吝啬花哟………………- Sub test()
- Dim d As Object, ar, br, r&, c%, sh As Worksheet, y%
- With Me
- ar = Intersect(.[aa1].CurrentRegion, .[aa:af])
- End With
- Set d = CreateObject("scripting.dictionary")
- For r = 7 To UBound(ar)
- If InStr(ar(r, 1), "-") Then
- d(ar(r, 1)) = r
- ar(r, 5) = 0
- End If
- Next
- For Each sh In Sheets
- With sh
- If .Name <> Me.Name Then
- br = .[a1].CurrentRegion.Resize(, 7)
- For r = 7 To UBound(br)
- If d.exists(br(r, 1)) Then
- y = d(br(r, 1))
- ar(y, 5) = ar(y, 5) + br(r, 6)
- End If
- Next
- End If
- End With
- Next
- With Me
- Intersect(.[aa1].CurrentRegion, .[aa:af]) = ar
- End With
- Set d = Nothing
- MsgBox "ok!"
- End Sub
复制代码 |
-
-
例表.rar
50.98 KB, 下载次数: 212
仅供参考
评分
-
1
查看全部评分
-
|