|
|
Generate file name according time - DisplayAlerts, If - False, GetSaveAsFilename, Strings.Format(Now, "s")
Public Sub File_Name()
Dim rndpass As String
Dim sFName As Variant
rndpass = "KJSS_" & Strings.Format(Now, "s") & Strings.Format(Now, "n") & Strings.Right(Strings.Format(Timer, "#0.00"), 2)
sFName = Application.GetSaveAsFilename(rndpass, "Excel files (*.xls), *.xls")
If sFName = False Then
Exit Sub
End If
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs Filename:=sFName
Application.DisplayAlerts = True
End Sub
|
|