save file with tdays date.

  • Thread starter Thread starter Steve
  • Start date Start 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?
 
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.
 
Back
Top