Can anyone tell me how can I change directory in this code
Like this code will create folder and sub folder on desktop
I want to change the directory to D:\ or E:\
Like this code will create folder and sub folder on desktop
I want to change the directory to D:\ or E:\
VBA Code:
Sub CreateFolders()
Dim sPath As String, sMain As String, sFolder As String
Dim i As Long
sPath = CreateObject("WScript.Shell").SpecialFolders("Desktop")
sMain = sPath & "\" & Sheets(1).Range("A1").Value
If Dir(sMain) = "" Then
MkDir sMain
End If
For i = 1 To 10
sFolder = sMain & "\" & Sheets(1).Range("B" & i).Value
If Dir(sFolder) = "" Then
MkDir sFolder
End If
Next
End Sub