Hi,
I have the 2 codes as mentioned below
1)
Sub test()
Dim fso As Object, mySir As String, temp As String
Set fso = CreateObject("Scripting.FileSystemObject")
myDir = "E:\test\"
On Error Resume Next
For Each r In Range("a1", Range("a" & Rows.Count).End(xlUp))
Err.Clear
temp = fso.CreateFolder(myDir & r.Value)
If Err = 0 Then
End If
Next
Set fso = Nothing
End Sub
2)
Sub sample()
Dim i As Long, myFolder As String
myFolder = "E:\joy\Week"
For i = 1 To 52
If Dir(myFolder & i, vbDirectory) = "" Then MkDir myFolder & i
Next
End Sub
The first code creates folders based on the values provided in Column A
The second code creates 52 folders of the 52 weeks in a year.
What i want to do is to create 52 folders ( 52 weeks) within each folder from column A
That is to create folder from the Column A and 52 sub folders in it.
Kindly help.
I have the 2 codes as mentioned below
1)
Sub test()
Dim fso As Object, mySir As String, temp As String
Set fso = CreateObject("Scripting.FileSystemObject")
myDir = "E:\test\"
On Error Resume Next
For Each r In Range("a1", Range("a" & Rows.Count).End(xlUp))
Err.Clear
temp = fso.CreateFolder(myDir & r.Value)
If Err = 0 Then
End If
Next
Set fso = Nothing
End Sub
2)
Sub sample()
Dim i As Long, myFolder As String
myFolder = "E:\joy\Week"
For i = 1 To 52
If Dir(myFolder & i, vbDirectory) = "" Then MkDir myFolder & i
Next
End Sub
The first code creates folders based on the values provided in Column A
The second code creates 52 folders of the 52 weeks in a year.
What i want to do is to create 52 folders ( 52 weeks) within each folder from column A
That is to create folder from the Column A and 52 sub folders in it.
Kindly help.
Last edited: