ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Autosaving files with different names (https://www.excelbanter.com/excel-programming/301586-autosaving-files-different-names.html)

Thomas L[_2_]

Autosaving files with different names
 
Hello. Quick question. I have created a macro do create a report for me. I want it to save the file to a specific drive (ie. \\pkcfp001\tlynch07\Sales Distribution Reports\). When the original file is created, the name is given as SalesBaseReport04112004.xls where the 04112004 represents the date for the data in the file. If possible, I would like it to take just the date portion and create a filename based on the date in 04.11.2004.xls or 04-11-2004.xls format. The filename will change on a daily basis with the date. Is it possible to make this happen?

Papou

Autosaving files with different names
 
Hi Thomas
Assuming date is today's:
Dim NameOFile$
NameOFile = Format(Date, "mm-dd-yyyy")
ThisWorkbook.SaveAs NameOFile & ".xls"

Regards
Pascal

"Thomas L" a écrit dans le message de
...
Hello. Quick question. I have created a macro do create a report for me.

I want it to save the file to a specific drive (ie.
\\pkcfp001\tlynch07\Sales Distribution Reports\). When the original file is
created, the name is given as SalesBaseReport04112004.xls where the 04112004
represents the date for the data in the file. If possible, I would like it
to take just the date portion and create a filename based on the date in
04.11.2004.xls or 04-11-2004.xls format. The filename will change on a
daily basis with the date. Is it possible to make this happen?



Thomas L[_2_]

Autosaving files with different names
 
Ok, I understand that, the only thing that would be different, is that the Date in the file is going to be behind 1 day (ie. File SalesBaseReport04112004.xls contains data from 4/11/04 but I wont receive it until 4/12/04 and want to save it as the data date, 4/11/04).

"Thomas L" wrote:

Hello. Quick question. I have created a macro do create a report for me. I want it to save the file to a specific drive (ie. \\pkcfp001\tlynch07\Sales Distribution Reports\). When the original file is created, the name is given as SalesBaseReport04112004.xls where the 04112004 represents the date for the data in the file. If possible, I would like it to take just the date portion and create a filename based on the date in 04.11.2004.xls or 04-11-2004.xls format. The filename will change on a daily basis with the date. Is it possible to make this happen?



All times are GMT +1. The time now is 09:21 PM.

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