Option
Explicit
Private
Const
STARTPATH
As
String
=
"C:\Users\Sebastian\Desktop\tmp"
Private
Const
YEAR
As
Integer
=
"2017"
Public
Sub
create_folder_structure()
Dim
fso
As
New
FileSystemObject
Dim
i
As
Integer
, j
As
Integer
Dim
strUpperPath
As
String
For
i = 1
To
12
strUpperPath = STARTPATH &
"\" & Format(i, "
00
") & "
" & MonthName(i)
fso.CreateFolder (strUpperPath)
For
j = 1
To
DateDiff(
"d"
, DateSerial(YEAR, i, 1), DateSerial(YEAR, i + 1, 1))
fso.CreateFolder (strUpperPath &
"\" & Format(j, "
00
") & "
" & WeekdayName(Weekday(DateSerial(YEAR, i, j), vbUseSystemDayOfWeek),
False
, vbUseSystemDayOfWeek))
Next
j
Next
i
Set
fso =
Nothing
End
Sub