Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
Dim str As String
If SaveAsUI Then
str = Format(Range("A1").Value, "yyyymmddhhmmss") & ".xls"
Application.EnableEvents = False
Application.Dialogs(xlDialogSaveAs).Show arg1:=str
Application.EnableEvents = True
Cancel = True
End If
End Sub
--
Rob van Gelder -
http://www.vangelder.co.nz/excel
"Leonard" wrote in message
...
I am trying to automatically (through a macro) save an excel file as a date
and time which is the value of the A1 cell. Is there a way to incorporate
the A1 cell value in the file name when you go to save as?