I'm struggling with this one. It continually errors out when attempt to create the dir.
Location of error is last line MKDir partsubfolder
Any assistance would be greatly appreciated. Thanks in advance!
Code below;
Location of error is last line MKDir partsubfolder
Any assistance would be greatly appreciated. Thanks in advance!
Code below;
VBA Code:
Dim sourceDir As String
Dim folder_exists As String
Dim partSubfolder As String
'source directory
sourceDir = "C:\Users\dans\documents\" & CustomerTB.Value & "\"
partSubfolder = sourceDir & PartNoCB.Value & "\"
'check if year subfolder exists, if it doesn't then create a new folder
folder_exists = Dir(partSubfolder, vbDirectory)
If folder_exists = vbNullString Then MkDir partSubfolder