|
すみません。
テストしてないのがバレバレです。
全体を再度Upします。
Sub test()
Dim File1 As Workbook
Dim File2 As Workbook
Dim i As Long
Set File2 = Workbooks("Book1.xls")
Set File1 = Workbooks.Open(Filename:="D:\Book2.xls")
For i = 1 To 8
With File1.Worksheets("Sheet" & i)
.Range(.Cells(1, 1), .Cells(65536, 1).End(xlUp)).Copy
End With
With File2.Worksheets("Sheet1")
.Cells(65536, 1).End(xlUp).Offset(IIf(.Cells(1, 1).Value = "", 0, 1)).PasteSpecial _
Paste:=xlValues
End With
Next i
File1.Close
Set File1 = Nothing
Set File2 = Nothing
End Sub
|
|