Output to excel or text with current date

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a macro set up to "Output To" the results of a
query to Excel. I have another set up to "Transfer Text"
from a table to a text file. Is there a way to add the
current date to the name of these output files? I tried
using & Date() in my Output File mapping; e.g.,
C:\MyDocuments\'File Name' &Date() The result was
literal. Any suggestions?
 
Yes. Use something like this for the filename argument:

="C:\FolderName\FileName" & Format(Date(), "mm-dd-yyyy") & ".xls"
 
Back
Top