Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro help inserting records by date sequence. | Excel Discussion (Misc queries) | |||
Are there any NON-Visual Basic solutions for inserting a picture based a derived or called filename? | Excel Worksheet Functions | |||
set filename to <filename-date on open | Excel Worksheet Functions | |||
filename in macro | Excel Discussion (Misc queries) | |||
Put Filename Variable in Macro | Excel Discussion (Misc queries) |