excel:vba-openfiles-infolder
フォルダ内のファイルを順番に開く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-infolder.txt · 最終更新: by shimehitsu14