save file with tdays date.

S

Steve

Is it possible to set a macro to save a file handle as
"real_text_dddd, mm/dd/yy" with the dates populated to the current
date?
 
R

Rick Rothstein

You can't use the slash character as part of a file name (if that is, in
fact, what you mean by "file handle"), so you will have to use a different
character for it in your filename. You can use the VB Format function to
create the date part of your file name; you can use VB's Date or Now
function as the argument for the Format function as they both contain the
current date (The Now function also returns the time as well as the date,
but the Format function can be used to filter it out). Here is an
example...

FileName = "real_text_" & Format(Now, "dddd, mm-dd-yyyy")

which would assign (for today's date) this text string...

real_text_Sunday, 02-22-2009

to the FileName variable.
 

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