ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

vba ²Ö¥[°ÝÃD

¦^´_ 3# color790


    §AAÄ檺¸ê®Æ¨S¦³§¹¥þ¸s²Õ¨ì
­«·s±Æ§Ç¹L§A´N·|µo²{
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¥»©«³Ì«á¥Ñ color790 ©ó 2011-10-24 23:03 ½s¿è

·PÁ¶W¯Åª©¥Dªº¨ó§U, ·P®¦¦A·P®¦.....  
¤¤¶¡»ù®æªº­pºâ¦n¹³¦³ÂI¿ù»~, ¦p®É¶¡¦b8450300, 8451500, 8452700....
¦ý¤p§Ì¥u·|¤ñ¸û°ò¥»ªº»yªk, ³o­Ó¤ñ¸û¤£À´, ¥i§_³Â·Ðª©¥DÀ°§Úµù¸Ñ¤@¤U, Åý§Ú¦h¾Ç¤@ÂI, ÁÂÁÂ~
ªì¾ÇªÌcolor

TOP

¥»©«³Ì«á¥Ñ Hsieh ©ó 2011-10-24 23:10 ½s¿è
  1. Sub ex()
  2. Set d = CreateObject("Scripting.Dictionary")  '¬ö¿ýB¡BCÄ檺­È
  3. Set d1 = CreateObject("Scripting.Dictionary")  '°O¿ý¨C¬í²Ä¤@­Ó¥X²{ªºªº»ù®æ

  4. For Each a In Range([A2], [A2].End(xlDown))  '¦bAÄæ¦ì°µ°j°é
  5.    If d.exists(a.Value) = False Then  '¦pªGAªº­È¨S³Q°O¿ý¦bd¦r¨å¤º
  6.       d(a.Value) = Array(a.Offset(, 1).Value, a.Offset(, 2).Value)  '±NB¡BCÄ檺­È°O¿ý¨ìd¦r¨å¤º
  7.       d1(a.Value) = a.Offset(, 1).Value  '°O¦í¨C¬í²Ä¤@­Ó¥X²{ªºªº»ù®æ
  8.       Else
  9.       ar = d(a.Value)  '¨ú¥Xd¦r¨å¹ïÀ³ªº¤º®e
  10.       ar(0) = a.Offset(, 1).Value - d1(a.Value)  '§âBÄ檺­È´î±¼¹ïÀ³AÄ檺­È(²Ä¤@¦¸¥X²{ªº­È)  
  11.       ar(1) = ar(1) + a.Offset(, 2).Value  'CÄæ¦ì¥[¤W«e¥[Á`ªº­È
  12.       d(a.Value) = ar  '§â°}¦C¦^¦s¨ì¦r¨å¤¤
  13.     End If
  14. Next
  15. [F2].Resize(d.Count, 1) = Application.Transpose(d.keys)  '§â¨C¬íªº¦r¦ê(¦r¨å¯Á¤Þ­È)¼g¤J
  16. [G2].Resize(d.Count, 2) = Application.Transpose(Application.Transpose(d.items))  '§â¦r¨å¤º®e¼g¤J
  17. End Sub
½Æ»s¥N½X
¦^´_ 1# color790
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

        ÀR«ä¦Û¦b : ¦Y­W¤F­W¡B­WºÉ¤Ü¨Ó¡A¨ÉºÖ¤FºÖ¡BºÖºÉ´d¨Ó¡C
ªð¦^¦Cªí ¤W¤@¥DÃD