Sub NewWB()
Dim p As String, q As String
p = ActiveWorkbook.Path
q = Sheets("prof").Range("C5").Value
ActiveSheet.Copy
With ActiveWorkbook
Application.DisplayAlerts = False
.SaveAs Filename:=p & "\Output\" & q & Format(Now, "dd-mm-yy hh-ss") & ".csv", FileFormat:=xlCSV
Application.DisplayAlerts = True
.Close
End With
End Sub
Sub NewWB()
Dim p As String, q As String
p = ActiveWorkbook.Path
q = Sheets("prof").Range("C5").Value
If Not DirExists(p & "\Output") Then MkDir (p & "\Output")
ActiveSheet.Copy
With ActiveWorkbook
Application.DisplayAlerts = False
.SaveAs Filename:=p & "\Output\" & q & " " & Format(Now, "dd-mm-yy hh-ss") & ".csv", FileFormat:=xlCSV
Application.DisplayAlerts = True
.Close savechanges:=True
End With
End Sub
Sub NewWB()
Dim p As String, q As String
p = ActiveWorkbook.Path
q = Sheets("prof").Range("C5").Value
If Not DirExists(p & "\Output") Then MkDir (p & "\Output")
ActiveSheet.Copy
With ActiveWorkbook
Application.DisplayAlerts = False
.SaveAs Filename:=p & "\Output\" & q & " " & Format(Now, "dd-mm-yy hh-ss") & ".csv", FileFormat:=xlCSV
Application.DisplayAlerts = True
.Close savechanges:=True
End With
End Sub
Function DirExists(SDirectory As String) As Boolean
If Dir(SDirectory, vbDirectory) <> "" Then DirExists = True
End Function