- ©«¤l
- 4901
- ¥DÃD
- 44
- ºëµØ
- 24
- ¿n¤À
- 4916
- ÂI¦W
- 81
- §@·~¨t²Î
- Windows 7
- ³nÅ骩¥»
- Office 20xx
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥x¥_
- µù¥U®É¶¡
- 2010-4-30
- ³Ì«áµn¿ý
- 2025-4-5
               
|
¦^´_ 14# b9208 - Sub ex()
- Set d = CreateObject("Scripting.Dictionary")
- Set d1 = CreateObject("Scripting.Dictionary")
- With Sheets("Sheet1")
- For Each a In .Range(.[B8], .[B8].End(xlDown))
- m = a.Text & "," & a.Offset(, 2) & "," & a.Offset(, 4)
- n = a.Text & "," & a.Offset(, 1) & "," & a.Offset(, 2)
- If d(m) <= a.Offset(, 7) Then _
- d(m) = a.Offset(, 7) '¨ú¥XB¡BD¡BFÄæ¦P²Õ³Ì¤jÈ
- d1(n) = "" 'B¡BC¡BDÄ椣«½Æ¯Á¤Þ
- Next
- End With
- For Each ky In d.keys
- ar = Split(ky, ",")
- d(ar(0) & ar(1)) = d(ar(0) & ar(1)) + d(ky) '¨ú¥XB¡BD¡BFÄæ¦P²Õ¥[Á`
- Next
- For Each ky In d1.keys
- ar = Split(ky, ",")
- d1(ar(0) & ar(2)) = d1(ar(0) & ar(2)) + 1 ''B¡BC¡BDÄæ²Õ¦Xp¼Æ
- Next
- With Sheets("Sheet2")
- For Each c In .[O7:P7]
- cnt = 0
- For Each a In .[N8:N14]
- .Cells(a.Row, c.Column) = IIf(d1(a & c) = "", 0, d1(a & c)) '¨Ì§Ç¶ñ¤J²Õ¦Xp¼Æ
- cnt = cnt + d1(a & c)
- Next
- .Cells(15, c.Column) = cnt
- Next
- For Each c In .[O7:P7]
- cnt = 0
- For Each a In .[N19:N25]
- .Cells(a.Row, c.Column) = IIf(d(a & c) = "", 0, d(a & c)) '¨Ì§Ç¶ñ¤J²Õ¦X¥[Á`
- cnt = cnt + d1(a & c)
- Next
- .Cells(26, c.Column) = cnt
- Next
- End With
- End Sub
½Æ»s¥N½X
T1.rar (13.39 KB)
|
|