- ©«¤l
- 438
- ¥DÃD
- 67
- ºëµØ
- 0
- ¿n¤À
- 531
- ÂI¦W
- 30
- §@·~¨t²Î
- win7
- ³nÅ骩¥»
- office 2010
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2012-10-30
- ³Ì«áµn¿ý
- 2024-10-24
|
¦^´_ 42# GBKEE
01.Option Explicit
02.Sub Ex()
03. Dim Rng(1 To 2) As Range
04. With Workbooks("payment.XLSM").Sheets("2012")
05. Set Rng(1) = .[E1000].End(xlUp).Offset(, -4) '³o Rng(1)ªº¦ì¸m
06. With Workbooks.Open("C:\Users\patrick.HKG\Desktop\Patrick.XLSX").Sheets("SHEET1")
07. Set Rng(2) = .[A2:L2]
08. Set Rng(2) = .Range(Rng(2), .[A2].End(xlDown))
09. MsgBox .Rows.Count - Rng(2).Rows.Count < .Rows.Count - Rng(1).Row 'True: Rng(2)½d³ò¤j©ó Rng(1) ´N¦³¿ù»~
10. Rng(2).Copy Rng(1)
11. .Parent.Close False
12. End With
13. End With
14.End Sub
¬ORng(2)½d³ò¤j©ó Rng(1)¡A¦ý¬OSet Rng(1) = .[E1000].End(xlUp).Offset(, -4) '³o Rng(1)ªº¦ì¸m ¡]³o¥yªº·N«ä¬O¤£¬Oµ¥©ó¥ÑE1000¶}©l©¹¤WÀˬd³Ì«á¤@¦C¡AOFFSET( , -4)±NEÄæ§ï¦¨AÄæ
Set Rng(2) = .Range(Rng(2), .[A2].End(xlDown))¬O§_·N«ä±qAÄæ²Ä¤G¦C¶}©l©¹¤U¨ì³Ì«á¤@µ§¡H |
|