Vba code to create folder or directory with name and condition

Following Excel Vba Code to create the folder in a directory if path is not exists.

 


 

Sub Create_Local_folder()
Set fs = CreateObject(“Scripting.FileSystemObject”)
AttendanceLocalFolder = “C:” & “” & “MYNEWFOLDER”
If fs.FolderExists(AttendanceLocalFolder) = False Then fs.CreateFolder AttendanceLocalFolder

 

End Sub