Inserting Date In Filename Using Macro

  • Thread starter Thread starter Mega_-__
  • Start date Start date
M

Mega_-__

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
 
Try this Mega

Dim strdate As String
strdate = Format(Now, "mm-dd-yy")
ActiveWorkbook.SaveAs Filename:="P:\MRP\mrp " & strdate & ".xls"
 
Worked like a charm. Bloody brilliant! This is truly a great forum

Thank
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top