Hello! So I've created the following formula that should create a new folder based on the year, but if it already exists, I don't want to create the new folder. This formula seemed to work well, until I did a troubleshoot of "2018" by replacing TodayYear with "2018"... it did not work then. Can someone please help me identify the error in my code?
Code:
'.............Definitions...................................................................
FolderName = "" & Format(Now(), "yyyy mm dd")
FileName = Format(Now(), "yyyymmdd") & "_SpecialRequests"
Path = "H:\DM\Requests"
TodayYear = Format(Now, "yyyy")
TodayFolder = Path & TodayYear & FolderName
'...........................................................................................
'Create new Folder in Requests Folder
If Len(Dir(Path & TodayYear, vbDirectory)) = 0 Then
Else
On Error Resume Next
MkDir (TodayFolder)
On Error GoTo 0
End If