|
こんにちは
シートすべての値をコピーなら
これで如何かな?
Sub コード表コピー()
Dim Va As Variant, Wb As Workbook
Dim Ws As Variant, i As Long
'作業時画面固定
Application.ScreenUpdating = False
i = 0
'振分元データ取得
Ws = Array("Sheet1", "Sheet2")
For Each Va In Array("C:\book1.xls", "C:\book2.xls")
Set Wb = Workbooks.Open(Va)
ThisWorkbook.Sheets("F 締日支払日ex").UsedRange.Copy
Wb.Sheets(Ws(i)).Range("A1").PasteSpecial xlPasteValues
Application.CutCopyMode = False
Wb.Close savechanges:=True
i = i + 1
Next Va
Application.ScreenUpdating = True
MsgBox "完了"
End Sub
|
|