- ©«¤l
- 2025
- ¥DÃD
- 13
- ºëµØ
- 0
- ¿n¤À
- 2053
- ÂI¦W
- 0
- §@·~¨t²Î
- WIN7
- ³nÅ骩¥»
- Office2007
- ¾\ŪÅv
- 100
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥x¥_¥«
- µù¥U®É¶¡
- 2011-3-2
- ³Ì«áµn¿ý
- 2024-3-14
|
- Sub ex()
- Set d = CreateObject("Scripting.Dictionary")
- ar = Array(Array("AA", "yes", "Cr", 111, 222), _
- Array("BB", "No", "Dr", 333, 444), _
- Array("CC", "yes", "Bl", 111, 222), _
- Array("AA", "yes", "Cr", 222, 333), _
- Array("CC", "yes", "Bl", 333, 555), _
- Array("CC", "yes", "Bl", 222, 111), _
- Array("BB", "No", "Dr", 444, 222))
- For i = LBound(ar) To UBound(ar)
- If Not d.exists(ar(i)(0)) Then
- d(ar(i)(0)) = ar(i)
- Else
- a = d(ar(i)(0))
- a(3) = a(3) + ar(i)(3)
- a(4) = a(4) + ar(i)(4)
- d(ar(i)(0)) = a
- End If
- Next
- [a1].Resize(7, 5) = Application.Transpose(Application.Transpose(ar))
- [a9].Resize(d.Count, 5) = Application.Transpose(Application.Transpose(d.Items))
- End Sub
½Æ»s¥N½X |
|