¥»©«³Ì«á¥Ñ oak0723-1 ©ó 2010-9-13 16:27 ½s¿è
Set d = CreateObject("Scripting.Dictionary")
<----¬Ý¤£À´,Áö¦³«ö"f1"¬dCreateObjectªº¸ÑÄÀ..¦ýÁÙ¬O¬Ý¤£À´,¥t¥~Scripting.Dictionary¬O¤°»ò·N«ä
With Sheet1
d(.[A1] & .[B1]) = .[C1]<----¤£À´d(.[A1] & .[B1]) ³oÓ¼gªkªº·N«ä~~~
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)) ³oÓ¼gªkªº·N«ä~~~
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)»PTranspose(d.items)¬O¤°»ò·N«ä
End With |