- ©«¤l
- 967
- ¥DÃD
- 0
- ºëµØ
- 0
- ¿n¤À
- 1001
- ÂI¦W
- 0
- §@·~¨t²Î
- WIN XP
- ³nÅ骩¥»
- OFFICE 2003
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥x¥_
- µù¥U®É¶¡
- 2010-11-29
- ³Ì«áµn¿ý
- 2022-5-17
|
¥»©«³Ì«á¥Ñ register313 ©ó 2012-4-28 18:25 ½s¿è
¦^´_ 4# white5168
¬O¦³³\¦hºÃÂI¥¼Âç²M
Á`¤§¥ýµ¹¨Ç¼Æ¾Ú(¤@¯ëªººâªk),¦A¤@¨B¤@¨B§Ë²M·¡§a- Sub aa()
- Dim d1, d2 As Object
- Set d1 = CreateObject("scripting.dictionary")
- Set d2 = CreateObject("scripting.dictionary")
- [G1:I65536] = ""
- [G1:I1] = Array("²£«~½s¸¹", "³Ñ¾l¼Æ¶q", "¥§¡»ù®æ")
- For B = 2 To [B2].End(xlDown).Row
- If Not d1.exists(Cells(B, 2).Value) Then
- d1.Add Cells(B, 2).Value, Cells(B, 4) - Cells(B, 5)
- d2.Add Cells(B, 2).Value, (Cells(B, 4) - Cells(B, 5)) * Cells(B, 3)
- Else
- d1(Cells(B, 2).Value) = d1(Cells(B, 2).Value) + Cells(B, 4) - Cells(B, 5)
- d2(Cells(B, 2).Value) = d2(Cells(B, 2).Value) + (Cells(B, 4) - Cells(B, 5)) * Cells(B, 3)
- End If
- Next B
- [G2].Resize(d1.Count, 1) = Application.Transpose(d1.keys)
- [H2].Resize(d1.Count, 1) = Application.Transpose(d1.items)
- [I2].Resize(d2.Count, 1) = Application.Transpose(d2.items)
- For I = 2 To d2.Count + 1
- If Cells(I, "H") = 0 Then
- Cells(I, "I") = 0
- Else
- Cells(I, "I") = Cells(I, "I") / Cells(I, "H")
- End If
- Next I
- End Sub
½Æ»s¥N½X |
|