excel:vba-openfiles-in-folder
フォルダ内のファイルを順番に開いて処理するVBA
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/07/26 14:57 by shimehitsu14