Public Sub Open_MultiSelet()
Dim FileList As Variant
Dim i As Long
FileList = Application.GetOpenFilename("Excelファイル (*.xlsx), *.xlsx", _
Title:="複数のファイルを開く", MultiSelect:=True)
If IsArray(FileList) Then
For i = 1 To UBound(FileList)
Workbooks.Open FileList(i)
Next i
Else
If FileList <> "False" Then
Workbooks.Open FileList
Else
MsgBox "キャンセルされました。"
End If
End If
End Sub
|