Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Inserting Date In Filename Using Macro


Hi, I dlike to write a macro to automatically "save as" a file with th
current date in the filename as well as the original filname i.e. MR
11-27-03.xls Current file name is MRP.xls. Any ideas?

The macro below is for reference, it just saves the file as MRP.xls.
just need someway to inckude the date.

Thanks
Steve


ChDir "P:\MRP"
ActiveWorkbook.SaveAs Filename:="P:\MRP\mrp.xls"
FileFormat:=xlNormal, _
Password:="", WriteResPassword:="", ReadOnlyRecommended:=False
_
CreateBackup:=Fals

-----------------------------------------------
~~ Message posted from http://www.ExcelTip.com
~~View and post usenet messages directly from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Inserting Date In Filename Using Macro

Try this Mega

Dim strdate As String
strdate = Format(Now, "mm-dd-yy")
ActiveWorkbook.SaveAs Filename:="P:\MRP\mrp " & strdate & ".xls"


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Mega_-__" wrote in message ...

Hi, I dlike to write a macro to automatically "save as" a file with the
current date in the filename as well as the original filname i.e. MRP
11-27-03.xls Current file name is MRP.xls. Any ideas?

The macro below is for reference, it just saves the file as MRP.xls. I
just need someway to inckude the date.

Thanks
Steve


ChDir "P:\MRP"
ActiveWorkbook.SaveAs Filename:="P:\MRP\mrp.xls",
FileFormat:=xlNormal, _
Password:="", WriteResPassword:="", ReadOnlyRecommended:=False,
_
CreateBackup:=False


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Inserting Date In Filename Using Macro


Worked like a charm. Bloody brilliant! This is truly a great forum

Thank

-----------------------------------------------
~~ Message posted from http://www.ExcelTip.com
~~View and post usenet messages directly from http://www.ExcelForum.com

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
Macro help inserting records by date sequence. Richard Excel Discussion (Misc queries) 4 September 18th 07 11:05 PM
Are there any NON-Visual Basic solutions for inserting a picture based a derived or called filename? The Great Attractor Excel Worksheet Functions 7 May 27th 07 04:38 AM
set filename to <filename-date on open bob engler Excel Worksheet Functions 2 July 13th 06 05:11 AM
filename in macro ynissel Excel Discussion (Misc queries) 7 June 12th 06 08:41 PM
Put Filename Variable in Macro David Excel Discussion (Misc queries) 4 December 27th 05 06:27 PM


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