- ©«¤l
- 254
- ¥DÃD
- 6
- ºëµØ
- 0
- ¿n¤À
- 310
- ÂI¦W
- 0
- §@·~¨t²Î
- W10
- ³nÅ骩¥»
- Excel 2016
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW
- µù¥U®É¶¡
- 2019-6-16
- ³Ì«áµn¿ý
- 2024-9-23
|
¦^´_ 1# qaqa3296
¦³ªÅ¦A¬Ý¬Ý ³o¼Ë¥i¤£¥i¥H- Sub test1()
- Application.ScreenUpdating = False
- [®Æ¥ó!C2:C6000].ClearContents '²M°£C¸ê®Æ
- Set xD = CreateObject("Scripting.Dictionary") '¦r¨å
- Sheets("®Æ¥ó").Select '¸õ¨ì
- arr = Range([¦ì¸m!A2], [¦ì¸m!D65536].End(xlUp))
- Range(Sheets(2).Cells(2, 1).End(xlDown), Sheets(2).Cells(2, 4)).Sort Sheets(2).Cells(2, 4).End(xlDown)
-
- For I = 1 To UBound(arr)
- If I = UBound(arr) Then Exit For
- If arr(I, 4) <> arr(I + 1, 4) Then
- xD(arr(I, 1)) = xD(arr(I, 1)) & "," & arr(I, 4)
- End If
- Next I
-
- Set xR = Range([A2], [A65536].End(xlUp))
- For Each xT In xR
- Cells(xT.Row, "C") = xD(xT.Value)
- Next
-
- Set xD = Nothing
- Application.ScreenUpdating = True
- End Sub
½Æ»s¥N½X |
|