
Active Member

May 1, 2020

I understand with Excel there is a way to create a file directory structure, with use of VBA. I understand that there is some functionality built into Excel 2019 which makes this easier than previous versions of Excel. I would like to use this within the school I work in to automate the setting up of a directory structure where there is a lot of repetition of folder structures. This would save a great deal of time and ensure consistency. Can anyone offer any guidance please?


October 5, 2010

Hi David,
Attached is some code that will create a folder structure based on the contents of the sheet. You can probably work out for yourself how it works by looking at it.
I didn't know how you intended this to work at your end so the code may need some adjustment.
Regards
Phil


October 5, 2010

Forgot to say that the code uses FSO (FileSystemObject) so in order for it to work you'll need to set a reference in the VBA Editor to the Microsoft Scripting Runtime Library.
How to do this is described here
Create Hyperlinked List Of Files from SubFolders
Cheers
Phil

Active Member

May 1, 2020

Hi Phil
Thanks - got this to work.
I didn't need to setup the FSO as this had already been done.
I notice that you have to create the folder above before you can create a sub folder. In other words you have to create the higher order folders first in the column B (above where you want to create a sub folder).
But that's OK as I can setup the folders in column b in an appropriate order
Regards
David
1 Guest(s)
