Friday, 6 July 2012

Folders, Subfolders & Files

Wouldn’t be useful to have a small application that could create a list of all folders, subfolders and files of a folder that you have selected? If you answered “yes” to the previous question then you should download this excel VBA application.

How to use it

Step 1. Download the file, open it and enable macros.

Enable macros in Excel

Step 2. Excel will be minimized and the program form will appear.

Folders, Subfolders & Files

Step 3. Press the Folders button and a browser window will pop up. 

Step 4. Specify the folder you need (for example: C:\Program Files). 

Select folder window
Step 5. Press OK button. Depending on the size of contents and your computer's hardware
            you might wait a  little bit.

Step 6. A new sheet will be added to the workbook containing the list of folders that are
            inside the Folder you selected (for example in the picture below there is a list of all
            the folders that are contained in my program files folder). The new sheet will have the
            same name with the folder you selected.

Folders result

Repeat the steps 1 to 6, but in the step 3 press the Sub-folders button.

Sub-folders result

Repeat the steps 1 to 6, but in the step 3 press the Files button. Note that if the folder you selected contains a lot of files the procedure will take some time to complete. So, don't worry if excel seems to not responding since it process the files. After some time it will return to its normal operational mode.

Files results

There also two other buttons in the form. If you press the Delete button all the sheets of the workbook will be deleted except for the main one. Finally, if you press the Close Application button the workbook will be closed but the changes will not be saved.

Download it from here

The zip file contains two workbooks, one for Office 2003 and another for newer Office versions. Note that you should enable macros in order to use these workbooks.

Read also

Did you like this post? If yes, then share it with your friends. Thank you!


Mechanical Engineer (Ph.D. cand.), M.Sc. Cranfield University, Dipl.-Ing. Aristotle University, Thessaloniki - Greece.
Communication: e-mail, Facebook, Twitter, Google+ and Linkedin. More info