Place 'date' in the file name of TransferText

  • Thread starter Thread starter EXPORTER
  • Start date Start date
E

EXPORTER

How can I place today's date in the file name of a
TransferText command in a Macro. I want each daily file
extract to have its own unique name and not write over
previous day.
 
I'm not sure you can do it in a macro, but try "MyFile" & Format(Date,
"yyyymmdd") & ".txt"

If that doesn't work, it's easy in VBA.
 
In a macro, put an expression in the box for the filename argument:

="C:\MyFolder\MyFilename" & Format(Date(), "mmddyyyy") & ".txt"
 
Worked perfectly! thanks for keeping it self-contained in
the Macro. Did not know about the = sign until today to
trigger the string.....
 
Back
Top