- ©«¤l
- 1446
- ¥DÃD
- 40
- ºëµØ
- 0
- ¿n¤À
- 1470
- ÂI¦W
- 0
- §@·~¨t²Î
- Windows 7
- ³nÅ骩¥»
- Excel 2010 & 2016
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW
- µù¥U®É¶¡
- 2020-7-15
- ³Ì«áµn¿ý
- 2024-10-21
|
ÁÂÁ½׾Â,ÁÂÁ¦U¦ì«e½ú
«á¾ÇÂǦ¹©«½m²ß°}¦C»P¦r¨å,¾Ç²ß¤è®×¦p¤U,½Ð¦U¦ì«e½ú«ü±Ð
Á`ªí:
°õ¦æµ²ªGA001:
°õ¦æµ²ªGA002:
°õ¦æµ²ªGA003:
Option Explicit
'³o¤è®×¬O¥H¦r¨åkey°O¿ý¤£«½Æªº³f¸¹,item°O¿ý¬Û¦P³f¸¹©Ò¦b¦C¸¹,¥H"/"¶¡¹j
Sub TEST_1()
Application.DisplayAlerts = False
'¡ô¥O¤£¥²¸ß°Ý¤u§@ªí¬O§_§R°£,ª½±µ§R¤F
Dim Brr, Crr, Z, Q, A, i&, j%, s%, N%
'¡ô«Å§iÅܼÆ:&¬Oªø¾ã¼Æ,%¬Oµu¾ã¼Æ,¨ä¾l¬O³q¥ÎÅܼÆ
Set Z = CreateObject("Scripting.Dictionary")
'¡ô¥OZÅܼƬO ¦r¨å
For Each A In Worksheets
If A.Name <> "Á`ªí" Then A.Delete
Next
'¡ô³]¶¶°j°é±N"Á`ªí"¥H¥~ªº¤u§@ªí§R°£
Brr = [A1].CurrentRegion: Crr = Brr
'¡ô¥OBrrÅܼƬO±a¤J°Ï°ìÀx¦s®æȪº¤Gºû°}¦C,¥OCrrÅܼƦPBrr°}¦C
For i = 3 To UBound(Brr): Z(Brr(i, 2)) = Z(Brr(i, 2)) & "/" & i: Next
'¡ô³]¶¶°j°é±N³f¸¹Âo«½Æ,¦ý¬O¥Hitem°O¿ý©Ò¦bªº¦C¸¹,¥H"/"²Å¸¹¶¡¹j
For s = 0 To Z.Count - 1
Q = Split(Z.ITEMS()(s), "/"): N = 2
For i = 1 To UBound(Q)
N = N + 1
For j = 1 To 8: Crr(N, j) = Brr(Q(i), j): Next
Next
Worksheets.Add.Name = Z.KEYS()(s): [A1].Resize(N, 8) = Crr
Next
'¡ô³]¶¶°j°é±N¥H¨CÓ³f¸¹·s¼W¤u§@ªí,±N¸ê®Æ¼g¤J¤u§@ªí¤¤
End Sub |
|