View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Norman Jones Norman Jones is offline
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