1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
Sub CreateNewFolder(ByVal TmpName As String)
Dim strDrive As String
Sheets("Control").Select
gvSTRPathSave = Sheets("Control").Range("B4").Value & "\"
If Dir(gvSTRPathSave & TmpName & "_" & Format(Date, "dd_mm_yyyy"), vbDirectory) = "" Then
strDrive = Left(gvSTRPathSave, 1)
ChDrive strDrive
ChDir gvSTRPathSave
MkDir "Export" & "_" & Format(Date, "dd_mm_yyyy")
End If
ActiveWorkbook.SaveCopyAs gvSTRPathSave & TmpName & "_" & Format(Date, "dd_mm_yyyy") & "\" & TmpName & "_" & Format(Date, "dd_mm_yyyy") & ".xlsm"
End Sub |
Partager