- ©«¤l
- 1446
- ¥DÃD
- 40
- ºëµØ
- 0
- ¿n¤À
- 1470
- ÂI¦W
- 0
- §@·~¨t²Î
- Windows 7
- ³nÅ骩¥»
- Excel 2010 & 2016
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW
- µù¥U®É¶¡
- 2020-7-15
- ³Ì«áµn¿ý
- 2024-10-21
|
¦^´_ 1# °a¤ªºµ
ÁÂÁ«e½úµoªí¦¹¥DÃD»P½d¨Ò
«á¾ÇÂǦ¹©«½m²ß¤@¤Gºû°}¦C»P¦r¨å,¾Ç²ßªº¸Ñ¨M¤è®×¦p¤U,½Ð«e½ú°Ñ¦Ò
°õ¦æ«e:
°õ¦æµ²ªG:
Option Explicit
Sub TEST()
Dim Brr, Crr, i&, j&, xR, R&, T, A, Y, Z
Set Y = CreateObject("Scripting.Dictionary")
Set xR = Range([F1], Cells(Rows.Count, "A").End(3))
Brr = xR: Z = Array(, 2, 3, 5)
ReDim Crr(1 To UBound(Brr, 2))
For i = 1 To UBound(Brr)
A = Y(Brr(i, 1) & "")
If Not IsArray(A) Then
A = Crr
For j = 1 To UBound(Crr): A(j) = Brr(i, j): Next
Else
For j = 1 To 3: A(Z(j)) = A(Z(j)) + Brr(i, Z(j)): Next
End If
Y(Brr(i, 1) & "") = A
Next
xR.Offset(, 14).EntireColumn.ClearContents
xR.Item(1, 15).Resize(Y.Count, UBound(Crr)) = _
Application.Transpose(Application.Transpose(Y.Items))
End Sub |
|