|
▼MLC さん:
こんにちは。
Book2の標準モジュールに記述して実行してみて下さい。
Sub Test()
Dim WkbName As String
Dim Wkb As Workbook
Dim Wst As Worksheet
Dim MySheet As Worksheet
Dim I As Long
Dim J As Long
J = 1
WkbName = "C:\Book1.xls"
Set MySheet = ActiveWorkbook.ActiveSheet
Application.Workbooks.Open (WkbName)
Set Wkb = ActiveWorkbook
For Each Wst In Wkb.Worksheets
With Wst
For I = 1 To .Cells(1, 1).End(xlDown).Row
MySheet.Cells(J, 3).Value = .Cells(1, 2).Value
MySheet.Cells(J, 4).Value = .Cells(I, 1).Value
MySheet.Cells(J, 5).Value = .Cells(I, 3).Value
J = J + 1
Next
End With
Next
Wkb.Close
Set Wkb = Nothing
Set MySheet = Nothing
End Sub
外していたらすみません。
|
|