|
単純にコピペするだけでいい、ということでしょーか ? ならば・・
Sub MyData_Copy()
Dim BAry As Variant
Dim DCnt As Integer, i As Integer
Dim MyB As Workbook, MyS As Worksheet
BAry = Array("出勤簿1.xls", "出勤簿2.xls", "出勤簿3.xls")
DCnt = Day(DateSerial(Year(Date), Month(Date) + 1, 0)) + 1
Application.ScreenUpDating = False
With ThisWorkbook
.WorkSheets("Sheet1").Cells.ClearContents
For i = 0 To 2
Set MyB = Workbooks.Open(.Path & "\" & BAry(i))
Set MyS = MyB.WorkSheets("Sheet1")
MyS.Range("A1", MyS.Range("A65536").End(xlUp)) _
.Resize(, DCnt).Copy .WorkSheets("Sheet1") _
.Range("A65536").End(xlUp).Offset(1)
MyB.Close False: Set MyS = Nothing: Set MyB = Nothing
Next i
.WorkSheets("Sheet1").Rows(1).Delete xlShiftUp
End With
Application.ScreenUpDating = True
End Sub
|
|