- ©«¤l
- 5923
- ¥DÃD
- 13
- ºëµØ
- 1
- ¿n¤À
- 5986
- ÂI¦W
- 0
- §@·~¨t²Î
- win10
- ³nÅ骩¥»
- Office 2010
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW°ò¶©
- µù¥U®É¶¡
- 2010-5-1
- ³Ì«áµn¿ý
- 2022-1-23
|
¥»©«³Ì«á¥Ñ GBKEE ©ó 2011-5-8 20:01 ½s¿è
¦^´_ 1# janejacky
§ó¥¿:
¸Õ¸Õ¬Ý- Sub Ex()
- Dim D(2) As Object, R As Variant, AR()
- Set D(0) = CreateObject("Scripting.Dictionary")
- Set D(1) = CreateObject("Scripting.Dictionary")
- Set D(2) = CreateObject("Scripting.Dictionary")
- With Sheets("¥X³f³æ")
- For Each R In .Range(.[B12], .[G29]).Rows '¥X³f³æ¤º®e½d³ò-> ªº¾ã¦C
- If Application.CountA(R) = 6 Then '¸ê®Æn»ô¥þ
- AR = Array(.[G4].Text, .[G5], .[B5], R.Cells(1, 1), R.Cells(1, 2), R.Cells(1, 3), R.Cells(1, 5), R.Cells(1, 6))
- D(1)(Join(AR, ",")) = AR
- End If
- Next
- End With
- With Sheets("¥X³f³æ¾ú¥v²Îp")
- For Each R In .Range(.[A3], .Cells(Rows.Count, "H").End(xlUp)).Rows
- If Application.CountA(R) = 8 Then D(0)(Join(Application.Transpose(Application.Transpose(R.Value)), ",")) = ""
- D(2)(R.Cells(1, 1) & R.Cells(1, 2)) = D(2)(R.Cells(1, 1) & R.Cells(1, 2)) + R.Cells(1, 8)
- Next
- For Each R In D(1).KEYS
- If D(0).EXISTS(R) = False Then
- With .Cells(Rows.Count, "A").End(xlUp).Offset(1)
- .Resize(, 8) = D(1)(R)
- D(2)(.Cells(1) & .Cells(1, 2)) = D(2)(.Cells(1) & .Cells(1, 2)) + .Cells(1, 8)
- End With
- End If
- Next
- For Each R In .Range(.[A3], .Cells(Rows.Count, "A").End(xlUp))
- If D(2).EXISTS(R & R(1, 2)) Then R(1, 9) = D(2)(R & R(1, 2))
- Next
- End With
- Set D(0) = Nothing
- Set D(1) = Nothing
- Set R = Nothing
- End Sub
½Æ»s¥N½X |
|