#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default File Names

I want to know if a macro can save a file with the name of
today's date, and and if so how is that done. Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default File Names


actuveworkbook.save filename:= "C:myDir\" & Format(Date,"yyyy-mmm-dd") &
".xls"

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Sharon Perez" wrote in message
...
I want to know if a macro can save a file with the name of
today's date, and and if so how is that done. Thanks!




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default File Names

Hi Sharon

Try this

One way to save a copy of the file in C:\ with a date-time stamp
You can also use SaveAs

Sub test()
Dim strdate As String
strdate = Format(Now, "dd-mm-yy h-mm-ss")
With ThisWorkbook
.SaveCopyAs "C:\Copy of " & .Name _
& " " & strdate & ".xls"
End With
End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl


"Sharon Perez" wrote in message ...
I want to know if a macro can save a file with the name of
today's date, and and if so how is that done. Thanks!



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
File names Augied Excel Worksheet Functions 3 January 14th 09 02:37 AM
Open Excel file get error with file names that have spaces in the Kozmo Setting up and Configuration of Excel 6 October 29th 08 02:51 AM
EXCEL97 FILE NAMES TRUNCATED TO THE FIRST LETTER IN THE FILE NAME Geoff Porter New Users to Excel 6 May 25th 06 08:31 PM
File Names James Stephens Excel Programming 1 November 12th 03 03:26 AM
file names mika. Excel Programming 3 September 13th 03 12:42 AM


All times are GMT +1. The time now is 11:42 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"