The following Macro is meant to search for a folder and if it does not exist then create it. It was working and now that i have changed something i get an "out of range" error on line 5 (DPT =). The cell reference is correct. Has anyone got any ideas?
Jason
Code:
Sub createDPT1()
Dim sDir As String
Dim DPT1 As String
sDir = "C:\Rosters 1.0\Rosters"
DPT1 = Worksheets("Roster W1 D1").Range("B3").Value
On Error GoTo ErrNotExist
ChDir (sDir & "\" & DPT1)
Exit Sub
ErrNotExist:
MkDir sDir & "\" & DPT1
End Sub