Listing Directory Files and Subfolders

Asked By 0 points N/A Posted on -
qa-featured

How can I determine if my file is a directory and how can I list all these files in a directory as well as the subfolders?

SHARE
Best Answer by Teodora Skil
Best Answer
Best Answer
Answered By 0 points N/A #149988

Listing Directory Files and Subfolders

qa-featured

Hi,

I found 2 links that will help you on your problem.

Here are the two links: http://allenbrowne.com/tips.html and http://excelexperts.com/VBA-Tips-List-Files-in-A-Folder

Teodora Skil

Answered By 563020 points N/A #149989

Listing Directory Files and Subfolders

qa-featured

Here is a VBA script that might help solve your problem. The script described in the image below will list all the files contained in a folder.

When you run the script, the output will display all the files’ exact path or URL, their file names, their file sizes, and the date when they were last modified. You will immediately see if there were actually duplicate files inside the folder and delete them so you can free up some space. The image below describes the contents of the folder and its subfolder. It’s actually noticeable here that both folders have or contain files with the same file name.

The image below describes the supposed output in Microsoft Office Excel. Here, it clearly displays the duplicate files contained in the folder specified.

This procedure is completely explained in detail at VBA Tips – List Files In A Folder.

Login/Register to Answer

Related Questions