ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Automatic File Saving (https://www.excelbanter.com/excel-discussion-misc-queries/48496-automatic-file-saving.html)

smoran

Automatic File Saving
 

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


--
smoran
------------------------------------------------------------------------
smoran's Profile: http://www.excelforum.com/member.php...o&userid=27753
View this thread: http://www.excelforum.com/showthread...hreadid=472964


Dave Peterson

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

Or something like that.

smoran wrote:

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

--
smoran
------------------------------------------------------------------------
smoran's Profile: http://www.excelforum.com/member.php...o&userid=27753
View this thread: http://www.excelforum.com/showthread...hreadid=472964


--

Dave Peterson


All times are GMT +1. The time now is 05:31 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com