20230226 1148 

 

REF

[1] "https://exceloffthegrid.com/vba-code-loop-files-folder-sub-folders/"

 

Sub LoopAllFilesInAFolder()

'Loop through all files in a folder
Dim fileName As Variant
zpath = ThisWorkbook.Path & "\"
fileName = Dir(zpath)
'fileName = Dir(Sheets("prmt").[b1])

i = 2
[a1] = "n"
[b1] = "file name"

While fileName <> ""
    Cells(i, 1) = i - 1
    Cells(i, 2) = fileName
    i = i + 1
    fileName = Dir
Wend

End Sub
Posted by Weneedu
,


출처: https://privatedevelopnote.tistory.com/81 [개인노트]