| 
    
     |  | Sub 集計ファイルに出力() Dim WB As Workbook
 Dim Ck As Boolean
 Dim 行 As Long, 列 As Long
 Dim モデル名 As String
 Dim mybtn As Integer
 
 行 = Range("K65536").End(xlUp).Row
 列 = ActiveCell.Column
 モデル名 = ActiveCell.Value
 mybtn = MsgBox("モデル " & モデル名 & " を出力します")
 If mybtn = 2 Then Exit Sub
 For Each WB In Workbooks
 If LCase(WB.Name) = モデル名 & ".xls" Then
 Ck = True: Exit For
 End If
 Next
 Application.ScreenUpdating = False
 If Ck = False Then
 Workbooks.Open ThisWorkbook.Path & "\" & モデル名 & ".xls"
 ThisWorkbook.Activate
 End If
 
 概ね、このような書き出しでよいと思います。他にはエラートラップするやり方も
 ありますが。
 
 |  |