Place 'date' in the file name of TransferText

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.
 
D

Douglas J. Steele

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.
 
K

Ken Snell

In a macro, put an expression in the box for the filename argument:

="C:\MyFolder\MyFilename" & Format(Date(), "mmddyyyy") & ".txt"
 
E

EXPORTER

Worked perfectly! thanks for keeping it self-contained in
the Macro. Did not know about the = sign until today to
trigger the string.....
 

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

Top