返回列表 上一主題 發帖

[發問] &煩請指導程式碼解釋的意思~~~

[發問] &煩請指導程式碼解釋的意思~~~

本帖最後由 oak0723-1 於 2010-9-13 16:27 編輯

Set d = CreateObject("Scripting.Dictionary")
<----看不懂,雖有按"f1"查CreateObject的解釋..但還是看不懂,另外Scripting.Dictionary是什麼意思
With Sheet1
d(.[A1] & .[B1]) = .[C1]<----不懂d(.[A1] & .[B1]) 這個寫法的意思~~~
For Each a In .Range(.[A2], .[A65536].End(xlUp))
   d(a & a.Offset(, 1)) = d(a & a.Offset(, 1)) + a.Offset(, 2)<----不懂d(a & a.Offset(, 1)) 這個寫法的意思~~~
Next
End With
With Sheet2
.Columns("A:B") = ""
.[A1].Resize(d.Count, 1) = Application.Transpose(d.keys)
.[B1].Resize(d.Count, 1) = Application.Transpose(d.items)
<----Transpose(d.keys)與Transpose(d.items)是什麼意思
End With

回復 2# oobird
發現有的程式碼沒完整顯示
再po一次

    Set d = CreateObject("Scripting.Dictionary")
With Sheet1
d(.[A1] & .[B1]) = .[C1]
For Each a In .Range(.[A2], .[A65536].End(xlUp))
   d(a & a.Offset(, 1)) = d(a & a.Offset(, 1)) + a.Offset(, 2)
Next
End With
With Sheet2
.Columns("A:B") = ""
.[A1].Resize(d.Count, 1) = Application.Transpose(d.keys)
.[B1].Resize(d.Count, 1) = Application.Transpose(d.items)
End With

TOP

        靜思自在 : 要比誰更受誰.不要比誰更怕誰。
返回列表 上一主題