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

Scripting.DictionaryªºÀ³¥Î

¦^´_ 10# samwang

ÁÂÁ±z¸ÑÄÀ.

TOP

ÁÂÁ½׾Â,ÁÂÁ¦U¦ì«e½ú
«á¾ÇÂǦ¹©«½m²ß°}¦C»P¦r¨å,¾Ç²ß¤è®×¦p¤U,½Ð¦U¦ì«e½ú«ü±Ð

¸ê®Æªí:


µ²ªGªí°õ¦æ«e:


°õ¦æµ²ªG:



Option Explicit
Sub TEST_1()
Dim Brr, Crr, Z, i&, j%, R&, Y&, T$
Set Z = CreateObject("Scripting.Dictionary")
Brr = Range([¤u§@ªí1!D1], [¤u§@ªí1!A65536].End(3))
ReDim Crr(1 To UBound(Brr), 1 To 3)
For i = 1 To UBound(Brr)
   T = Brr(i, 2) & "|" & Brr(i, 4)
   R = Z(T)
   If R = 0 Then
      Y = Y + 1: R = Y
      For j = 1 To 3: Crr(R, j) = Brr(i, j + 1): Next
      Z(T) = R: GoTo i01
   End If
   Crr(R, 2) = Crr(R, 2) + Brr(i, 3)
i01: Next
With [Summary!A1].Resize(Y, 3)
   .EntireColumn.ClearContents
   .Value = Crr
End With
Set Z = Nothing: Erase Brr, Crr
End Sub
¥Î¦æ°Ê¸Ë¸mÂsÄý½×¾Â¾Ç²ß«Ü¤è«K,ÁÂÁ½׾¸gÀç¹Î¶¤
½Ð¤j®a¤@°_¤W½×¾Â¨Ó¥æ¬y

TOP

        ÀR«ä¦Û¦b : ¡i¬°µ½Ävª§¡j¤H¥Í­n¬°µ½Ävª§¡A¤À¬í¥²ª§¡C
ªð¦^¦Cªí ¤W¤@¥DÃD