Hi,
If I wanted to test if any of these filepaths exist and if not to create, what would be the simplest way to nest create? e.g. S:\Folder1\Folder2\Folder3\Folder4
What I've been using is.. but can it be shortened?
If I wanted to test if any of these filepaths exist and if not to create, what would be the simplest way to nest create? e.g. S:\Folder1\Folder2\Folder3\Folder4
What I've been using is.. but can it be shortened?
Code:
If Len(Dir("S:\Folder1\", vbDirectory)) = 0 Then
MkDir ("S:\Folder1\"
End If
If Len(Dir("S:\Folder1\Folder2\", vbDirectory)) = 0 Then
MkDir ("S:\Folder1\Folder2\")
End If
If Len(Dir("S:\Folder1\Folder2\Folder3\", vbDirectory)) = 0 Then
MkDir ("S:\Folder1\Folder2\Folder3\")
End If
If Len(Dir("S:\Folder1\Folder2\Folder3\Folder4\", vbDirectory)) = 0 Then
MkDir ("S:\Folder1\Folder2\Folder3\Folder4\")
End If
Last edited: