Posted to microsoft.public.excel.programming
|
|
Date formula in file name
I am in the workbook and press alt+F11 then double click on workbook and this
brings up a new window
" wrote:
No Problem. We'll get it worked out. Are you placing this code in the
workbook module?
santaviga wrote:
Sorry to be pain but all text is RED except for End Sub, and still not
working, must be doing something wrong do I have to run macro or anything
else, when I save the file only returning the name I give it?
Mark
" wrote:
What section is appearing in red? I tested before posting and it
worked fine.
santaviga wrote:
Hi,
I have done this in VB came up with error, OK'd it and now text red, closed
VB and tried saving file and not inputting date when looking at the file name
Mark
" wrote:
Try this:
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
ActiveWorkbook.SaveAs Filename:="Stock as of " & Format(Date,
"yyyy-mm-dd") & ".xls"
End Sub
santaviga wrote:
Hi,
I'm looking to see if possible a date is inserted before or after the file
name on saving.
e.g. Stock as of 25/10/2006 (this as the file name auto updated when the
file is saved by the user.
Is this possible???
Thanks
|