- ©«¤l
- 430
- ¥DÃD
- 65
- ºëµØ
- 0
- ¿n¤À
- 521
- ÂI¦W
- 30
- §@·~¨t²Î
- win7
- ³nÅ骩¥»
- office 2010
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2012-10-30
- ³Ì«áµn¿ý
- 2024-8-13
|
¦^´_ 17# GBKEE
01.Option Explicit
02.Sub EX()
03. Dim Rng(1 To 2) As Range
04. 'With Workbooks.Open("C:\USER\DESTOP\E.XLSX").Sheets("2012") 'ÀÉ®×¥¼¶}±Ò®É¥Î¦¹µ{¦¡½X
05. With Workbooks("E.XLSX").Sheets("2012") 'Àɮפw¶}±Ò®É¥Î¦¹µ{¦¡½X
06.
07. .Range("A1").CurrentRegion.Offset(1) = "" '²M°£Â¸ê®Æ
08.
09. 'A2:AM2 to A100:AM100 ¬OY:\2012\A.XLSX (2012) ªº¸ê®Æ
10. Set Rng(1) = .[A2] '²Ä¤@ÓRng(1)
11. With Workbooks.Open("Y:\2012\A.XLSX").Sheets("2012") 'Àɮ׶}±Ò
12. Set Rng(2) = .[A2:AM2]
13. Set Rng(2) = .Range(Rng(2), .[A2].End(xlDown)) '¸ê®Æ¤£°±¼W¥[: ¨ì³Ì«áªº¸ê®Æ
14. Rng(2).Copy Rng(1)
15. .Parent.Close False 'ÀÉ®×Ãö³¬
16. End With
17. 'A101:AM101 to A150:AM150¬OC:\2012\B.XLSX (Nov)ªº¸ê®Æ
18. Set Rng(1) = Rng(1).End(xlDown).Offset(1) '²Ä¤GÓRng(1)
19. With Workbooks.Open("Y:\2012\B.XLSX").Sheets("Nov") 'Àɮ׶}±Ò
20. Set Rng(2) = .[A101:AM101]
21. Set Rng(2) = .Range(Rng(2), .[AM101].End(xlDown)) '¸ê®Æ¤£°±¼W¥[: ¨ì³Ì«áªº¸ê®Æ
22. Rng(2).Copy Rng(1)
23. .Parent.Close False 'ÀÉ®×Ãö³¬
24. End With
25. 'A151:AM151 to A270:AM270¬OZ:\2012\C.XLSX (2012) ªº¸ê®Æ
26. Set Rng(1) = Rng(1).End(xlDown).Offset(1) '²Ä¤TÓRng(1)
27. With Workbooks.Open("Z:\2012\C.XLSX").Sheets("2012") 'ÀÉ®×¥¼¶}±Ò
28. Set Rng(2) = .[A151:AM151] '²Ä¤G¦C ¶}©l
29. Set Rng(2) = .Range(Rng(2), .[AM151].End(xlDown)) '¸ê®Æ¤£°±¼W¥[: ¨ì³Ì«áªº¸ê®Æ
30. .Parent.Close False 'ÀÉ®×Ãö³¬
31. End With
32. End With
33.End Sub
³o¸Ì¦³Ó»~·|¡A§Úªº·N«ä¬O»¡copyªº¸ê®Æ¤£ª¾¹D¬O¦h¤Ö¡A¤§«e´£¥Xªº100¡A50 ¡A120¬OÁ|¨Ò¡C
With Workbooks.Open("Y:\2012\A.XLSX").Sheets("2012") ¦Û°Ê±q²Ä¤G¦C¶}©lcopy¹L¥h¡Acopy ªº¦ì¸m±q²Ä¤G¦C¶}©l¶¶§Ç©¹¤Ucopy ,ª½¨ì A.XLSX³Ì«á¤@¦Cªº¸ê®Æ,
With Workbooks.Open("Y:\2012\B.XLSX").Sheets("Nov") ¦Û°Ê±q²Ä¤G¦C¶}©lcopy¹L¥h¡Acopy ªº¦ì¸m©Ó±µ¤W¤@ÓFILE A.XLSXªº³Ì«á¤@¦C¤§«á,ª½¨ì B.XLSX³Ì«á¤@¦Cªº¸ê®Æ,
With Workbooks.Open("Z:\2012\C.XLSX").Sheets("2012") ¦Û°Ê±q²Ä¤G¦C¶}©lcopy¹L¥h¡Acopy ªº¦ì¸m©Ó±µ¤W¤@ÓFILE B.XLSXªº³Ì«á¤@¦C¤§«á,ª½¨ì C.XLSX³Ì«á¤@¦Cªº¸ê®Æ, |
|