|
こいいうことですか?
基本的なところで想像が入っていますので、よく確認して下さい。
Sub test()
Dim wbJikkou As Workbook
Dim mypath As String
Dim mybook As String
Dim i As Long, a As Long, b As Long, c As Long
Dim wb As Workbook
Dim ws As Worksheet
Set wbJikkou = Workbooks.Open(FileName:="実行ブック")
mypath = "c:\保存している場所\"
mybook = Dir(mypath & "*.xls")
Do While mybook <> ""
Set wb = Workbooks.Open(FileName:=mypath & mybook)
Set ws = wb.Worksheets(1)
i = 1
Do While ws.Cells(i, 2).Value <> ""
If ws.Cells(i, 2).Value = "実行" Then
a = ws.Cells(i, 3).Value
b = ws.Cells(i, 4).Value
c = ws.Cells(i, 5).Value
'処理 'このなかでwbJikkouを参照して処理を行う
End If
i = i + 1
Loop
wb.Close False
mybook = Dir()
Loop
End Sub
|
|