Sub AllFilenames()
Rem Change D:\ to your folder path
D = "D:\"
Cells(1, 1) = "Filenames"
r = 2
f = Dir(D, 7)
Do While f <> ""
Cells(r, 1) = f
r = r + 1
f = Dir
Loop
End Sub
4. Run
5. File - close and return to Excel
The Open and Save As dialog boxes in Windows do not support "tree view",
you will need to use Windows Explorer.
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.