Hi all,
I would like to create folders from a list. Each item in Col A needs to be a parent folder and Col B and Col C need to be the child folders for each.
Example:
Excel 2010
[Table="width:, class:grid"][tr][td]Sheet: Sheet2[/td][/tr][/table]
I tried to copy and past code from post http://www.mrexcel.com/forum/excel-questions/872763-create-folder-subfolders-cell.html but get Run-time error 424.
The code I used:
......I would like to get the following results:
C:\The_NEWS\France\Paris\Nice\Marseille\Lyon\Nantes
C:\The_NEWS\Desktop\Italy\Milan\Naples\Rome\Turin\Genoa
C:\The_NEWS\UK\London\Manchester\Liverpool\Oxford\Preston
I have not been able to find a post addressing the copy and past error that return Run-time error 424 - Object Required.
Since I am new at VBA I am not sure if I did something wrong. I created a new module and pasted the code, changed the folder location in the code and tried to run the code.
Your assistance or pointing in the right direction would be much appreciated.
I would like to create folders from a list. Each item in Col A needs to be a parent folder and Col B and Col C need to be the child folders for each.
Example:
Excel 2010
A | B | C | |
1 | France | Paris | Nice |
2 | UK | London | Manchester |
3 | Italy | Milan | Naples |
I tried to copy and past code from post http://www.mrexcel.com/forum/excel-questions/872763-create-folder-subfolders-cell.html but get Run-time error 424.
The code I used:
Code:
Sub CreateFolderStructure()
For Each objRow In UsedRange.Rows
strFolders = "C:\The_NEWS\"
For Each ObjCell In objRow.Cells
strFolders = strFolders & "\" & ObjCell
Next
Shell ("cmd /c md " & Chr(34) & strFolders & Chr(34))
Next
End Sub
......I would like to get the following results:
C:\The_NEWS\France\Paris\Nice\Marseille\Lyon\Nantes
C:\The_NEWS\Desktop\Italy\Milan\Naples\Rome\Turin\Genoa
C:\The_NEWS\UK\London\Manchester\Liverpool\Oxford\Preston
I have not been able to find a post addressing the copy and past error that return Run-time error 424 - Object Required.
Since I am new at VBA I am not sure if I did something wrong. I created a new module and pasted the code, changed the folder location in the code and tried to run the code.
Your assistance or pointing in the right direction would be much appreciated.