- ©«¤l
- 102
- ¥DÃD
- 17
- ºëµØ
- 0
- ¿n¤À
- 129
- ÂI¦W
- 0
- §@·~¨t²Î
- windows
- ³nÅ骩¥»
- 2010
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2012-5-16
- ³Ì«áµn¿ý
- 2020-9-2
|
¥»©«³Ì«á¥Ñ lalalada ©ó 2012-8-13 16:09 ½s¿è
©êºp¤@¶}©l±Ôz¤£²M
§Ú§âì¨Óªºcode¥[¤Wµù¸Ñ- Dim Ar()
- Set d = CreateObject("scripting.dictionary")
- Set dic = CreateObject("scripting.dictionary")
- Set dtemp = CreateObject("scripting.dictionary")
- Ar = Range("A6:E" & [E6].End(xlDown).Row)
- For i = 1 To UBound(Ar)
- If dtemp.exists(Left(Ar(i, 2), 4)) = False Then 'Y¦r¨å3¥N½X¥¼¬ö¿ý
- d(Ar(i, 2)) = Ar(i, 4) '¦r¨å1¬ö¿ý¥þ¦W¤Î¯Á¤Þ1
- dic(Ar(i, 2)) = Ar(i, 5) '¦r¨å2¬ö¿ý¥þ¦W¤Î¯Á¤Þ2
- dtemp(Left(Ar(i, 2), 4)) = Ar(i, 4) '¦r¨å3¬ö¿ý¥N½X¤Î¯Á¤Þ
- MsgBox "d:" & d(Ar(i, 2)) & d.keys & " dic:" & dic(Ar(i, 2)) & " dtemp:" & dtemp(Left(Ar(i, 2), 4))
- Else 'Y¦r¨å3¥N½X¤w°O¿ý
- dtemp(Left(Ar(i, 2), 4)) = dtemp(Left(Ar(i, 2), 4)) + Ar(i, 4) '¦r¨å3¯Á¤Þ1¥[Á`
- d(Ar(i, 2)) = d(Ar(i, 2)) + Ar(i, 4) '¦r¨å1(¥þ¦W)¯Á¤Þ1¥[Á`
- dic(Ar(i, 2)) = dic(Ar(i, 2)) + Ar(i, 5) '¦r¨å2(¥þ¦W)¯Á¤Þ2¥[Á`
- MsgBox "ELSE ""d:" & d(Ar(i, 2)) & " dic:" & dic(Ar(i, 2)) & " dtemp:" & dtemp(Left(Ar(i, 2), 4))
- End If
- Next i
- [L6].Resize(d.Count, 1) = Application.Transpose(d.keys) '¿é¥X¥þ¦W
- [M6].Resize(d.Count, 1) = Application.Transpose(d.items) '¿é¥X¯Á¤Þ1
- [N6].Resize(dic.Count, 1) = Application.Transpose(dic.items) '¿é¥X¯Á¤Þ2
½Æ»s¥N½X ´«¥y¸Ü»¡
§Æ±æ³Ì«á¯à¿é¥X¦r¨å1ªº¥þ¦W©M¦r¨å3ªº¯Á¤ÞÈ...."
¥Ø«e°ÝÃD¥d¦b·í±ø¥ó¬°§_
dtemp¥i½T¹ê¥[Á`¦ýd,dic¤£¦æ(¥Ñmsgbox¥i¥HÆ[¹î¨ì)
·PÁª©¤j¦^´_:)
¥»¨Ó¥H¬°¤w¸g¨I¨ì¶³²`¤£ª¾³B |
|