Function MkDir2(Optional path = "")
'path为空的时候 直接返回日期时间命名的文件夹
'path不为空的时候 按指定path创建新文件夹
If path = "" Then
path = ThisWorkbook.path & "\" & Format(Now, "yyMMdd_HHmmss")
End If
If Dir(path, vbDirectory) = "" Then
MkDir path '建立文件夹
End If
MkDir2 = path
End Function