- ©«¤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-11-19
|
¦^´_ 32# GBKEE
Option Explicit
Sub copy()
Dim Rng(1 To 2) As Range
'With Workbooks.Open("C:\Users\patrick.HKG\Desktop\COPY.XLSM").Sheets("2012")
With Workbooks("payment.XLSM").Sheets("2012")
.Range("A1").CurrentRegion.Offset(1) = ""
Set Rng(1) = .[A2]
With Workbooks.Open("C:\Users\patrick.HKG\Desktop\Jenny.XLSX").Sheets("SHEET1")
Set Rng(2) = .[A2:AL2]
Set Rng(2) = .Range(Rng(2), .[A2].End(xlDown))
Rng(2).copy Rng(1)
.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:AL2]
Set Rng(2) = .Range(Rng(2), .[AL2].End(xlDown))
Set Rng(2) = Rng(2).Resize(.[E1].End(xlDown).Row - 1)
Rng(2).copy Rng(1)
.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:AL2]
Set Rng(2) = .Range(Rng(2), .[AL2].End(xlDown))
Set Rng(2) = Rng(2).Resize(.[E1].End(xlDown).Row - 1)
Rng(2).copy Rng(1)
.Parent.Close False
End With
Set Rng(1) = Rng(1).End(xlDown).Offset(1)
With Workbooks.Open("C:\Users\patrick.HKG\Desktop\Connie.XLSX").Sheets("sheet1")
Set Rng(2) = .[A2:AL2]
Set Rng(2) = .Range(Rng(2), .[AL2].End(xlDown))
Set Rng(2) = Rng(2).Resize(.[E1].End(xlDown).Row - 1)
Rng(2).copy Rng(1)
.Parent.Close False
End With
Set Rng(1) = Rng(1).End(xlDown).Offset(1)
With Workbooks.Open("C:\Users\patrick.HKG\Desktop\Patrick.XLSX").Sheets("sheet1")
Set Rng(2) = .[A2:AL2]
Set Rng(2) = .Range(Rng(2), .[AL2].End(xlDown))
Set Rng(2) = Rng(2).Resize(.[E1].End(xlDown).Row - 1)
Rng(2).copy Rng(1)
.Parent.Close False
End With
End With
End Sub
Set Rng(1) = Rng(1).End(xlDown).Offset(1) ¥X²{ERROR :RUN-TIME ERROR '1004'; APPLICATION-DEFINED OR OBJECT-DEFINED ERROR |
|