- ©«¤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
|
¦^´_ 39# GBKEE
Option Explicit
Sub Ex() 'µ{§Ç¦WºÙ¤£n¥Î copy ³o¬Ovba¤èªkªºÃöÁä¦r
Dim Rng(1 To 2) As Range
With Workbooks("payment.XLSM").Sheets("2012")
.Range("A1").CurrentRegion.Offset(1) = ""
Set Rng(1) = .[E2] 'EÄæ¸ê®Æ¦³³sÄò
'MsgBox Rng(1).Cells(1, -3).Address '¦^¨ìAÄæ
With Workbooks.Open("C:\Users\patrick.HKG\Desktop\Connie.XLSX").Sheets("SHEET1")
Set Rng(2) = .[A2:L2]
Set Rng(2) = Rng(2).Resize(.[E1].End(xlDown).Row - 1)
Rng(2).copy Rng(1).Cells(1, -3) 'AÄæ
.Parent.Close False
End With
Set Rng(1) = Rng(1).End(xlDown).Offset(1)
With Workbooks.Open("C:\Users\patrick.HKG\Desktop\Lily.XLSX").Sheets("SHEET1")
Set Rng(2) = .[A2:L2]
' **** Set Rng(2) = .Range(Rng(2), .[a2].End(xlDown)) ***** ³o¦æ¤£n¥Î
Set Rng(2) = Rng(2).Resize(.[E1].End(xlDown).Row - 1)
Rng(2).copy Rng(1).Cells(1, -3)
.Parent.Close False
End With
Set Rng(1) = Rng(1).End(xlDown).Offset(1)
With Workbooks.Open("C:\Users\patrick.HKG\Desktop\Jane.XLSX").Sheets("SHEET1")
Set Rng(2) = .[A2:L2]
' **** Set Rng(2) = .Range(Rng(2), .[a2].End(xlDown)) ***** ³o¦æ¤£n¥Î
Set Rng(2) = Rng(2).Resize(.[E1].End(xlDown).Row - 1)
Rng(2).copy Rng(1).Cells(1, -3)
.Parent.Close False
End With
Set Rng(1) = Rng(1).End(xlDown).Offset(1)
With Workbooks.Open("C:\Users\patrick.HKG\Desktop\Jenny.XLSX").Sheets("SHEET1")
Set Rng(2) = .[A2:L2]
' **** Set Rng(2) = .Range(Rng(2), .[a2].End(xlDown)) ***** ³o¦æ¤£n¥Î
Set Rng(2) = Rng(2).Resize(.[E1].End(xlDown).Row - 1)
Rng(2).copy Rng(1).Cells(1, -3)
.Parent.Close False
End With
Set Rng(1) = Rng(1).End(xlDown).Offset(1) 'µ{¦¡run ¨ì³o¸Ì¥X²{°ÝÃD application-defined or object-defined error
With Workbooks.Open("C:\Users\patrick.HKG\Desktop\Patrick.XLSX").Sheets("SHEET1")
Set Rng(2) = .[A2:L2]
' **** Set Rng(2) = .Range(Rng(2), .[a2].End(xlDown)) ***** ³o¦æ¤£n¥Î
Set Rng(2) = Rng(2).Resize(.[E1].End(xlDown).Row - 1)
Rng(2).copy Rng(1).Cells(1, -3)
.Parent.Close False
End With
End With
End Sub
³Ì«á¤@Ó¥X²{°ÝÃD
Set Rng(1) = Rng(1).End(xlDown).Offset(1) 'µ{¦¡run ¨ì³o¸Ì¥X²{°ÝÃD application-defined or object-defined error
¥t¥~¤¤¶¡¦³¤@¦CªÅ®æ¡A¤§«áªº¸ê®Æ´NµLªk¥X¨Ó¡C¦ý²Ä¤@¦¸ªºµ{¦¡¡A¦bcopy ²Ä¤@Óexcel ´Nºâ¤¤¶¡¦³¤@¦CªÅ®æ¡A¥¦¤]¥i¥H©¹¤Ucopy? |
|