Hi all,
I created a little sub to rename and save my daily to do list in a specific folder with a specific name. However, instead of creating a folder named "10.Oct18" I would like it to be "10.OCT18". I tried to wrap "UCase" around the relevant function, but it doesn't work. Ideas?
Any help is appreciated!!!
I created a little sub to rename and save my daily to do list in a specific folder with a specific name. However, instead of creating a folder named "10.Oct18" I would like it to be "10.OCT18". I tried to wrap "UCase" around the relevant function, but it doesn't work. Ideas?
Code:
Public Sub NewDay()
Application.DisplayAlerts = False
Dim macroWB As Workbook
Dim fileName As String
Dim BaseDir1 As String, BaseDir2 As String, BaseDir3 As String
BaseDir1 = "C:\\Alex\My Documents\ToDo's\"
BaseDir2 = BaseDir1 & Year(Now()) & "\"
BaseDir3 = BaseDir2 & Format(Now(), "mm") & "." & UCase(Format(Now(), "mmmyy")) & "\"
Call CheckForPaths(BaseDir1, BaseDir2)
Call CheckOnePath(BaseDir3)
fileName = BaseDir3 & Format(Now(), "mm.dd.yy") & ".xlsm"
Set macroWB = ThisWorkbook
macroWB.Sheets("ToDo's").Activate
macroWB.SaveAs fileName, 52
macroWB.Save
Set macroWB = Nothing
Application.DisplayAlerts = True
End Sub
Public Sub CheckForPaths(sPath1 As String, sPath2 As String)
If Len(Dir(sPath1, vbDirectory)) = 0 Then
MkDir (sPath1)
End If
If Len(Dir(sPath2, vbDirectory)) = 0 Then
MkDir (sPath2)
End If
End Sub
Public Sub CheckOnePath(sPath3 As String)
If Len(Dir(sPath3, vbDirectory)) = 0 Then
MkDir (sPath3)
End If
End Sub
Any help is appreciated!!!