Automatic File Saving

S

smoran

Hello,

I need a macro that will automatically save an excel file, with a
unique file name each time, it would be good if it could put the date
and time into the file name. If its not possible to put the date and
time into the file name, then just generating a unique file name will
be enough.

How would I go about doing this ?

Regards

Stephen
 
D

Dave Peterson

dim myFileName as string
myfilename = "C:\" & format(now,"yyyymmdd_hhmmss") & ".xls"
Activeworkbook.saveas filename:=myfilename, fileformat:=xlworkbooknormal

Or something like that.
 
Top