mscurtin9294
New Member
- Joined
- Mar 28, 2022
- Messages
- 2
- Office Version
- 365
- Platform
- Windows
I am looking for help with creating a macro to create folder and subfolders per below. I have a list of level 1 folders in column A. Then I have possible subfolders below level 1 in columns B thru H. If a subfolder is required a “Yes” is placed in the applicable cell.
The macro would check if there is a name in column A (starting at A2), if present it would create that Level 1 folder. Then for that row, it would check for cells with a “Yes” and create the applicable subfolders below the Level 1 folder for that row. It would go thru each row until there is no value in column A row. I have attached an image showing the table setup and derived folder paths. I also copied mini sheet below of that table shown in the image.
Users would create an “AB_Folders_Temp” folder on their desktop before running the macro. The folders described above would all be placed within this folder. Ideally if that folder already exists and has content the macro would delete any content before making the new folders.
I am a novice at macros. I have some of the parts working but nothing that would loop as described above. I have done a bunch of searches on this site and others but am still looking for help.
Thank you for any assistance,
Mark
The macro would check if there is a name in column A (starting at A2), if present it would create that Level 1 folder. Then for that row, it would check for cells with a “Yes” and create the applicable subfolders below the Level 1 folder for that row. It would go thru each row until there is no value in column A row. I have attached an image showing the table setup and derived folder paths. I also copied mini sheet below of that table shown in the image.
Users would create an “AB_Folders_Temp” folder on their desktop before running the macro. The folders described above would all be placed within this folder. Ideally if that folder already exists and has content the macro would delete any content before making the new folders.
I am a novice at macros. I have some of the parts working but nothing that would loop as described above. I have done a bunch of searches on this site and others but am still looking for help.
Thank you for any assistance,
Mark
Direct_Mk_Folders.xlsm | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | |||
1 | Subfolder 1 Name | Subfolder 2 Name | Subfolder 3 Name | Subfolder 4 Name | Subfolder 5 Name | Subfolder 6 Name | Subfolder 7 Name | |||
2 | Folder L1 Title | Required | Required | Required | Required | Required | Required | Required | ||
3 | Name 1 | Y | Y | |||||||
4 | Name 2 | Y | Y | Y | ||||||
5 | Name 3 | Y | ||||||||
6 | ||||||||||
7 | ||||||||||
8 | ||||||||||
9 | ||||||||||
10 | C:\Users\username\Desktop\AB_Folders_Temp\Name 1\ | |||||||||
11 | C:\Users\username\Desktop\AB_Folders_Temp\Name 1\Subfolder 1 Name | |||||||||
12 | C:\Users\username\Desktop\AB_Folders_Temp\Name 1\Subfolder 3 Name | |||||||||
13 | C:\Users\username\Desktop\AB_Folders_Temp\Name 2\ | |||||||||
14 | C:\Users\username\Desktop\AB_Folders_Temp\Name 2\Subfolder 2 Name | |||||||||
15 | C:\Users\username\Desktop\AB_Folders_Temp\Name 2\Subfolder 3 Name | |||||||||
16 | C:\Users\username\Desktop\AB_Folders_Temp\Name 2\Subfolder 5 Name | |||||||||
17 | C:\Users\username\Desktop\AB_Folders_Temp\Name 3\ | |||||||||
18 | C:\Users\username\Desktop\AB_Folders_Temp\Name 3\Subfolder 3 Name | |||||||||
Sheet3 |