Creating subfolders in a number of existing folders

LizzieMOC

New Member
Joined
Jan 4, 2018
Messages
2
Hi all

I am quite new to VBA and have found a number of the posts on this board really helpful!

I have come across a query I haven't been able to find an answer for though - I have 60 folders, each assigned to a different client, and within each of these is the same set of subfolders.

I am looking to create a further sub folder within each of these filing structures as in the following example

Client1/1.Finance/1.1.Finance Reports
Client2/1.Finance/1.1.Finance Reports
Client3/1.Finance/1.1.Finance Reports
and so on...

I would like my new folder to be "1.1.1. New Folder Name"

I have used a VBA code to create new folders before, but this relied on the workbook being saved in the destination folder so was more designed for creating multiple sub folders in one location.

I thought perhaps listing each file path I would like the folder to be created in would be an option, but creating this (if it is even a viable option) is both completely beyond my capabilities and I also don't know whether this will be the best way of going about the issue.

Please could someone help / advise?

Thank you!
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Welcome to MrExcel forums.

Search for a recursive FileSystemObject procedure which traverses the directory tree starting at the folder which is the parent of Client1, Client2 and Client3, etc. The new folder should be created when it reaches a folder which contains no subfolders.

The code at https://www.mrexcel.com/forum/excel...-sub-folder-tree-post4978310.html#post4978310 with my change in post no. 2 should be a good starting point, though changes would be needed. Use fso.CreateFolder to create the new folder.
 
Upvote 0

Forum statistics

Threads
1,223,886
Messages
6,175,198
Members
452,617
Latest member
Narendra Babu D

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top