Ok so I have the following vba code which I am using to check if a directory exists and if not create the folder structure like so:
If Dir("S:\Tasks\" & Range("C" & ActiveCell.Row).Value & "\" & Range("M" & ActiveCell.Row).Value & "\" & Range("Z" & ActiveCell.Row).Value, vbDirectory) = "" Then
MkDir Path:="S:\Tasks\" & Range("C" & ActiveCell.Row).Value & "\" & Range("M" & ActiveCell.Row).Value & "\" & Range("Z" & ActiveCell.Row).Value
MsgBox "Done"
Else
MsgBox "found it"
End If
So my destination path is my S:\ drive
then depending on the value in cell c I want it to check if that folder exists, so if cell c had the word 'tender' in it then the directory would look like:
'S:\Tender'
If this does not exist, then create, else if this exists then move on and create another folder within this folder with the value in cell M like so:
Cell M = Telecoms
'S:\Tender\Telecoms'
Then finally, check if a folder with the value in cell Z exists within 'S:\Tender\Telecoms' and if not create it.
Cell Z = 12345
so we would end up with:
'S:\Tender\Telecoms\12345\'
Fore some reason I keep getting the error message path not found. Please can someone show me where I am going wrong? Thanks in advance