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

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
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,227
Messages
6,170,848
Members
452,361
Latest member
d3ad3y3

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