Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default showing current date as part of file name

I have a workbook created in Excel 2002. Its name always includes the
current date, for example: "040409 Securities.xls". (I have always formatted
the date as YYMMDD, but would change that format if it assisted my doing
what I mention below.) The file is updated Monday through Friday afternoons
each week.

I have recently automated almost every step of the updating. Now, when I
open the most recent file, all updating is done automatically up to and
including the opening of the Save As dialog box. However, that box always
includes, in the default file name for saving, a date earlier than the
current date. I then have to change that date manually to today's date
before saving the file.

I found in an old MS KB article (139723) a method of prompting in the Save
As dialog box to save a file with a particular name:
Application.Dialogs(xlDialogSaveAs).Show ("xxx.xls"). That also worked for
Excel 2002, I found.

However, is there a way in which I can have that box prompt me to save the
file with the date part of the file name already being whatever is the
current date?


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,327
Default showing current date as part of file name

Hi

Application.Dialogs(xlDialogSaveAs).Show (Format(Date, "yymmdd") &
"xxx.xls")

HTH. Best wishes Harald

"Leslie" <leslieunderscorekatz@agddotnswdotgovdotau skrev i melding
...

Application.Dialogs(xlDialogSaveAs).Show ("xxx.xls"). That also worked for
Excel 2002, I found.

However, is there a way in which I can have that box prompt me to save the
file with the date part of the file name already being whatever is the
current date?




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default showing current date as part of file name

Hi
try something like the following:

Sub foo()
Dim old_fname
Dim new_fname
Dim save_fname
old_fname = "040409 Securities.xls"
new_fname = Format(Date, "MMDDYY") & Mid(old_fname, 7)
save_fname = Application.GetSaveAsFilename(new_fname)
MsgBox save_fname
'Me.SaveAs Filename:=save_fname

End Sub


--
Regards
Frank Kabel
Frankfurt, Germany


Leslie wrote:
I have a workbook created in Excel 2002. Its name always includes the
current date, for example: "040409 Securities.xls". (I have always
formatted the date as YYMMDD, but would change that format if it
assisted my doing what I mention below.) The file is updated Monday
through Friday afternoons each week.

I have recently automated almost every step of the updating. Now,
when I open the most recent file, all updating is done automatically
up to and including the opening of the Save As dialog box. However,
that box always includes, in the default file name for saving, a date
earlier than the current date. I then have to change that date
manually to today's date before saving the file.

I found in an old MS KB article (139723) a method of prompting in the
Save As dialog box to save a file with a particular name:
Application.Dialogs(xlDialogSaveAs).Show ("xxx.xls"). That also
worked for Excel 2002, I found.

However, is there a way in which I can have that box prompt me to
save the file with the date part of the file name already being
whatever is the current date?


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Only part of text showing in the cell UT Excel Discussion (Misc queries) 0 February 8th 09 11:21 PM
Why is Excel 07 only showing gridlines on part of the sheet? xpedite Excel Discussion (Misc queries) 2 March 10th 07 02:18 PM
Can I automatically enter the current date or current time into a Ben New Users to Excel 7 October 19th 05 03:38 PM
Showing the column of current day Sepiax Excel Worksheet Functions 1 January 11th 05 11:33 AM
Saving file with current date rglasunow[_7_] Excel Programming 2 January 23rd 04 07:15 PM


All times are GMT +1. The time now is 03:20 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"