Hello all
This piece of code checks to see if a folder with the value "MyContact" exists and if not creates a folder on my S Drive with the folder with the value of "MyContact"
It then saves the active sheet in this folder with the value from "MyFileName and "Mydate"
What I want is another two levels of folders that the code can check to see if they are there and if not then create them.
IE
Folder one = MyContact
Inside this folder = MyFileName
Inside this folder = AssetName
All values of the above folders
Could any person please help me on this as I have tried various versions on the above code but can't get it to work correctly
This piece of code checks to see if a folder with the value "MyContact" exists and if not creates a folder on my S Drive with the folder with the value of "MyContact"
It then saves the active sheet in this folder with the value from "MyFileName and "Mydate"
Code:
sDir = "S:\Records\test\Customers\" & MyContact
If Len(Dir(sDir, vbDirectory)) = 0 Then
MkDir sDir
End If
ActiveSheet.SaveAs Filename:=sDir & "\" & MyFileName & " " & MyDate & ".xlsx"
What I want is another two levels of folders that the code can check to see if they are there and if not then create them.
IE
Folder one = MyContact
Inside this folder = MyFileName
Inside this folder = AssetName
All values of the above folders
Could any person please help me on this as I have tried various versions on the above code but can't get it to work correctly