excel-vba:openfiles-in-folder
フォルダ内のファイルを順番に開いて処理する
Dim path, fso, file, files Dim wb As Workbook path = ThisWorkbook.path & "/hoge" Set fso = CreateObject("Scripting.FileSystemObject") Set files = fso.GetFolder(path).files For Each file In files Set wb = Workbooks.Open(file) '処理を記述 ActiveWorkbook.Close SaveChanges:=False Next file
スポンサーリンク
excel-vba/openfiles-in-folder.txt · 最終更新: 2024/11/03 16:19 by shimehitsu14