Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Can anyone help me with the following;
I've got an original folder with several original subfolders. With VBA I want to create a testfolder with the same name as the original folder but in another location. Then I want to create testsubfolders in the new testfolder with the same names as the original subfolders. Greetings. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Here is some code
'----------------------------------------------------------------------- Sub NewFolders() '----------------------------------------------------------------------- Dim FSO As Object Dim oSubFolder As Object Dim oFolder As Object Set FSO = CreateObject("Scripting.FileSystemObject") Set oFolder = FSO.GetFolder("C:\MyTest") MkDir "C:\Backups" MkDir "C:\Backups\" & oFolder.shortname For Each oSubFolder In oFolder.Subfolders MkDir "C:\Backups\" & oFolder.shortname & "\" & oSubFolder.Name Next End Sub -- HTH RP (remove nothere from the email address if mailing direct) "pieros" wrote in message oups.com... Can anyone help me with the following; I've got an original folder with several original subfolders. With VBA I want to create a testfolder with the same name as the original folder but in another location. Then I want to create testsubfolders in the new testfolder with the same names as the original subfolders. Greetings. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Bob thank you very much!! With some modifications it works very well!!
Thank's again. Greetings, Pieros. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to decide folder-depth or How to select more folders/subfolders (folder-tree) ? | Excel Discussion (Misc queries) | |||
copy subfolders, replace text in files and save files in copied subfolders | Excel Programming | |||
Delete all files within a folder (incl subfolders) | Excel Programming | |||
Create subfolders in a folder | Excel Programming | |||
Trouble making a report of all Files within a Folder and all Subfolders? | Excel Programming |