|
複数のブックを、[Ctrl]キーを押しながら選択できるダイアログを出す方法。
Sub Get_MySheets()
Dim MyF As Variant
Dim MyB As Workbook
Dim i As Long
With Application
MyF = .GetOpenFilename(MultiSelect:=True)
If VarType(MyF) = 11 Then Exit Sub
.ScreenUpdating = False
.DisplayAlerts = False
End With
Set MyB = Workbooks.Add(xlWBATWorksheet)
For i = LBound(MyF) To UBound(MyF)
Workbooks.Open MyF(i)
With ActiveWorkbook
.Worksheets(1).Copy After:= _
MyB.Worksheets(MyB.Worksheets.Count)
.Close False
End With
Next i
MyB.Worksheets(1).Delete
With Application
.ScreenUpdating = True
.DisplayAlerts = True
End With
End Sub
|
|