- ©«¤l
- 561
- ¥DÃD
- 160
- ºëµØ
- 0
- ¿n¤À
- 725
- ÂI¦W
- 0
- §@·~¨t²Î
- WINDOWS
- ³nÅ骩¥»
- xp
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ®ç¶é
- µù¥U®É¶¡
- 2014-9-10
- ³Ì«áµn¿ý
- 2024-8-7
|
DEAR ALL ¤j¤j
1.SHEET1 RANGE¸ê®Æ»¡©ú¦p¤U
1.1 AÄæ=¤Hû¸ê®Æ®w BÄæ=¤é´Á¸ê®Æ®w CÄæ=¥[¯Z®É¼Æ¸ê®Æ®w EÄæ=¹w¬d´M¤§ALL¤Hû¦WºÙ FÄæ=«ü©w¤ë¥÷(10301)¤§¸ÓûÁ`¥[¯Z®É¼Æ
¨Ò A B C E F(10301)
ù 1030102 5 ù 10
Ĭ 1030506 5 Ĭ 0
´¿ 1030125 5
ù 1030109 5
ù 1031212 5
2.¦p¹Ï¤@ ¤p§Ì¬d´M¦³«e½ú¼gÃþ¦üSUMIF¤è¦¡.¤p§Ìקï«á¶È¥i§ì¨ú ¹ïÀ³ AÄæ ¤§ C Äæ¥[Á` ¦p¦ó¥[¤J BÄæ ®É¶¡=10301¤§±ø¥ó
Ãþ¨ç¼ÆSUMPRODUCT¤§¦h±ø¥ó¤è¦¡.·Ð¤£§[½ç±Ð THANKS
¹Ï¤@
Sub TTT()
Dim ds As Object, arr1, arr2, i&
Set ds = CreateObject("Scripting.Dictionary")
With Sheet1
arr2 = .Range(.[a2], .[C2].End(xlDown))
End With
With Sheet1
arr1 = .Range(.[E2], .[E2].End(xlDown))
For i = 1 To UBound(arr1)
ds(arr1(i, 1)) = 0
Next i
For i = 1 To UBound(arr2)
ds(arr2(i, 1)) = ds(arr2(i, 1)) + arr2(i, 3)
Next i
.[F2].Resize(ds.Count, 1) = Application.Transpose(ds.items)
End With
Set ds = Nothing
End Sub |
|