掲題の通り、任意の複数のExcelブックのセルの値を取得する方法。
「の」が多いな。
Sub ボタン1_Click() Dim fileNames As Variant Dim fileName As Variant Dim tmpSheet As Worksheet fileNames = Application.GetOpenFilename(MultiSelect:=True) If IsArray(fileNames) Then For Each fileName In fileNames Workbooks.Open fileName Set tmpSheet = ActiveWorkbook.Worksheets(1) tmpSheet.Activate Debug.Print tmpSheet.Cells(1, 1).Value Set tmpSheet = Nothing ActiveWorkbook.Close Next fileName Else Exit Sub End If End Sub