Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Excel macro: Add date to file name

Posted on 2002-04-23
2
Medium Priority
?
526 Views
Last Modified: 2012-05-04
I've got an excel macro that I run that saves a file.  What I need to do is add the current date to the file name so that I can have an archive of all the log files instead of writing over my log file.  The snippet of code is below.  

Working correctly, the macro would save the file named below as "042302log_rsa.xls"

ActiveWorkbook.SaveAs Filename:= _
        "log_RSA.xls", FileFormat:= _
        xlNormal, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False _
        , CreateBackup:=False
0
Comment
Question by:johnc98
2 Comments
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 200 total points
ID: 6962837
ActiveWorkbook.SaveAs Filename:= _
       Format(now, "MMDDYY") & "log_RSA.xls", FileFormat:= _
       xlNormal, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False _
       , CreateBackup:=False

CHeers
0
 

Author Comment

by:johnc98
ID: 6962861
Super-fast!  Thanks a ton Angelll.

John
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Windows Explorer let you handle zip folders nearly as any other folder: Copy, move, change, and delete, etc. In VBA you can also handle normal files and folders, but zip folders takes a little more - and that you'll find here.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

886 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question