- 帖子
- 65
- 主題
- 15
- 精華
- 0
- 積分
- 87
- 點名
- 0
- 作業系統
- WINDOWS10
- 軟體版本
- 2019
- 閱讀權限
- 20
- 性別
- 男
- 註冊時間
- 2010-7-26
- 最後登錄
- 2025-7-23
|
上一個問題是我dim有加了一句dim g as range,改了之後又出現另一個
Set g = CreateObject("Scripting.Dictionary")
For Each sh In Sheets(Array("派夾報宣傳車", "NP、CF"))
With sh
R = 3
gt = .Cells(R, 1)
Do Until gt > Sheets("日報表").[E2]
For Each a In .Range(.[B2], .[B2].End(xlToRight))
W = a.Offset(-1, 0).MergeArea.Cells(1, 1) ----------- 型態不符
g(W & a) = g(W & a) + .Cells(R, a.Column).Value
Next
R = R + 1
dt = .Cells(R, 1)
Loop
End With
Next
With Sheets("日報表")
For Each a In .[B15:B26]
at = a
For Each b In .[P14:U14]
If b.Column > 18 Then at = ""
.Cells(a.Row, b.Column) = g(b & at)
Next
Next
End With |
|