Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Save As "something" then date


Hi,

I'm looking for a way automatically save an excel sheet with a date i
the filename for easy identification. id like it to follow the forma
below

dd-mm-yy Stats.xls

the code i have is:

Sub SaveDate()



ActiveWorkbook.SaveAs Filename:= _
"C:\Documents and Settings\Andrew\Desktop\" & Format(Date, dd
mm - yy) & "Stats"

End Sub

The problem i have is that it saves as the number which excel generate
for dates so if it was the 1/1/1900 it would save as 00001 stats.xls

obviously i cant have the date as 1/1/1900 stats.xls as windows wouldn
accept it

any ideas?

thanks in advanc

--
andywalke
-----------------------------------------------------------------------
andywalker's Profile: http://www.excelforum.com/member.php...fo&userid=2441
View this thread: http://www.excelforum.com/showthread.php?threadid=38218

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Save As "something" then date

Hi Andy,

Try:

ActiveWorkbook.SaveAs Filename:= _
"C:\Documents and Settings\Andrew\Desktop\" & _
Format(Date, "dd - mm - yy") & " Stats"

Note the quotation marks and the space before Stats.

---
Regards,
Norman



"andywalker" wrote
in message ...

Hi,

I'm looking for a way automatically save an excel sheet with a date in
the filename for easy identification. id like it to follow the format
below

dd-mm-yy Stats.xls

the code i have is:

Sub SaveDate()



ActiveWorkbook.SaveAs Filename:= _
"C:\Documents and Settings\Andrew\Desktop\" & Format(Date, dd -
mm - yy) & "Stats"

End Sub

The problem i have is that it saves as the number which excel generates
for dates so if it was the 1/1/1900 it would save as 00001 stats.xls

obviously i cant have the date as 1/1/1900 stats.xls as windows wouldnt
accept it

any ideas?

thanks in advance


--
andywalker
------------------------------------------------------------------------
andywalker's Profile:
http://www.excelforum.com/member.php...o&userid=24418
View this thread: http://www.excelforum.com/showthread...hreadid=382184



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Save As "something" then date

You might as well also use the date for sorting

ActiveWorkbook.SaveAs Filename:= _
"C:\Documents and Settings\Andrew\Desktop\" & Format(Date, "yyyy-mm-dd") &
"Stats"

--

HTH

RP
(remove nothere from the email address if mailing direct)


"andywalker" wrote
in message ...

Hi,

I'm looking for a way automatically save an excel sheet with a date in
the filename for easy identification. id like it to follow the format
below

dd-mm-yy Stats.xls

the code i have is:

Sub SaveDate()



ActiveWorkbook.SaveAs Filename:= _
"C:\Documents and Settings\Andrew\Desktop\" & Format(Date, dd -
mm - yy) & "Stats"

End Sub

The problem i have is that it saves as the number which excel generates
for dates so if it was the 1/1/1900 it would save as 00001 stats.xls

obviously i cant have the date as 1/1/1900 stats.xls as windows wouldnt
accept it

any ideas?

thanks in advance


--
andywalker
------------------------------------------------------------------------
andywalker's Profile:

http://www.excelforum.com/member.php...o&userid=24418
View this thread: http://www.excelforum.com/showthread...hreadid=382184



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Save As "something" then date


Thanks that worked great

And

--
andywalke
-----------------------------------------------------------------------
andywalker's Profile: http://www.excelforum.com/member.php...fo&userid=2441
View this thread: http://www.excelforum.com/showthread.php?threadid=38218

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
Selecting "Save As" adds "Copy of" to file name- MS Excel 2007 ronhansen Excel Discussion (Misc queries) 1 November 15th 09 09:33 PM
"CELL("FILENAME") NOT UPDATE AFTER "SAVE AS" ACTION yossie6 Excel Discussion (Misc queries) 1 June 16th 08 12:16 PM
"Save" and "Save As" options greyed out - "Save as Webpage" option Bill Excel Discussion (Misc queries) 0 January 16th 07 04:47 PM
"Subscript out of range" error for: Workbooks("Test1.xls").Save Just12341234 Excel Programming 2 June 17th 05 03:16 PM
save and restore "Workbook Menu Bar" & "Cell" menus Jeff Higgins Excel Programming 2 February 14th 05 01:33 AM


All times are GMT +1. The time now is 08:26 PM.

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

About Us

"It's about Microsoft Excel"