Dear All,
I am currently using the coding below to create new folders in a drive, a couple of problems I have are that if the folders exists the command wont create a folder, and also I have to update my SS with all new folder locations, I was wondering if there is a way to search a drive and for each instance of the previous month(September) it creates a folder called October next to it, for example.
h:\reports\September (create a folder here as september found)
H:\new reports\September(create a folder here as september found)
I currently have approx 80 folders to create and also remember to add to the ss so the current coding will create new folders. Is there a way of adapting the current coding to do this for me.
Current Coding
Sub Create_Folders()
Sheets("copy_Folder"
.Select
For R = 2 To 64 'data in rows 2-61
On Error Resume Next
Application.ScreenUpdating = False
folderloc = Cells(R, 1)
MonthNam = Cells(R, 2)
completeadd = (folderloc & MonthNam)
MkDir (completeadd)
Next R
MsgBox "All New Folders Created", vbInformation
Any help will be greatly appreciated.
Rob.
I am currently using the coding below to create new folders in a drive, a couple of problems I have are that if the folders exists the command wont create a folder, and also I have to update my SS with all new folder locations, I was wondering if there is a way to search a drive and for each instance of the previous month(September) it creates a folder called October next to it, for example.
h:\reports\September (create a folder here as september found)
H:\new reports\September(create a folder here as september found)
I currently have approx 80 folders to create and also remember to add to the ss so the current coding will create new folders. Is there a way of adapting the current coding to do this for me.
Current Coding
Sub Create_Folders()
Sheets("copy_Folder"
For R = 2 To 64 'data in rows 2-61
On Error Resume Next
Application.ScreenUpdating = False
folderloc = Cells(R, 1)
MonthNam = Cells(R, 2)
completeadd = (folderloc & MonthNam)
MkDir (completeadd)
Next R
MsgBox "All New Folders Created", vbInformation
Any help will be greatly appreciated.
Rob.