- ©«¤l
- 4901
- ¥DÃD
- 44
- ºëµØ
- 24
- ¿n¤À
- 4916
- ÂI¦W
- 259
- §@·~¨t²Î
- Windows 7
- ³nÅ骩¥»
- Office 20xx
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥x¥_
- µù¥U®É¶¡
- 2010-4-30
- ³Ì«áµn¿ý
- 2024-11-30
|
¥»©«³Ì«á¥Ñ Hsieh ©ó 2011-10-24 23:10 ½s¿è
- Sub ex()
- Set d = CreateObject("Scripting.Dictionary") '¬ö¿ýB¡BCÄ檺È
- Set d1 = CreateObject("Scripting.Dictionary") '°O¿ý¨C¬í²Ä¤@Ó¥X²{ªºªº»ù®æ
- For Each a In Range([A2], [A2].End(xlDown)) '¦bAÄæ¦ì°µ°j°é
- If d.exists(a.Value) = False Then '¦pªGAªºÈ¨S³Q°O¿ý¦bd¦r¨å¤º
- d(a.Value) = Array(a.Offset(, 1).Value, a.Offset(, 2).Value) '±NB¡BCÄ檺ȰO¿ý¨ìd¦r¨å¤º
- d1(a.Value) = a.Offset(, 1).Value '°O¦í¨C¬í²Ä¤@Ó¥X²{ªºªº»ù®æ
- Else
- ar = d(a.Value) '¨ú¥Xd¦r¨å¹ïÀ³ªº¤º®e
- ar(0) = a.Offset(, 1).Value - d1(a.Value) '§âBÄ檺ȴ¹ïÀ³AÄ檺È(²Ä¤@¦¸¥X²{ªºÈ)
- ar(1) = ar(1) + a.Offset(, 2).Value 'CÄæ¦ì¥[¤W«e¥[Á`ªºÈ
- d(a.Value) = ar '§â°}¦C¦^¦s¨ì¦r¨å¤¤
- End If
- Next
- [F2].Resize(d.Count, 1) = Application.Transpose(d.keys) '§â¨C¬íªº¦r¦ê(¦r¨å¯Á¤ÞÈ)¼g¤J
- [G2].Resize(d.Count, 2) = Application.Transpose(Application.Transpose(d.items)) '§â¦r¨å¤º®e¼g¤J
- End Sub
½Æ»s¥N½X ¦^´_ 1# color790 |
|