ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   File Names (https://www.excelbanter.com/excel-worksheet-functions/107489-file-names.html)

[email protected]

File Names
 
I am trying to create a backup file using an autoexec macro, but am
unable to find the command to put in the macro to create the file name.

I need to have the file name auto-incremental depending on what name is
in the folder.

Could anyone also tell me how to create the file name as the current
date..

Thanks.

Reply »


Allllen

File Names
 
Hello Chris,

How about this. It doesn't go and look in the folder for what is already
there, but it saves your active workbook as for example "BACKUP 080629.xls"
inside the folder you specify.

If you really want to get it to look in the folder to see what is there,
then add one, post the question under excel programming.

ActiveWorkbook.SaveAs Filename:="\\SERVER\FOLDER\"BACKUP" & Format(Year(Now)
- 2000, "00") & Format(Month(Now), "00") & Format(Day(Now), "00") & ".xls"


HTH
---
Allllen

--
Allllen


" wrote:

I am trying to create a backup file using an autoexec macro, but am
unable to find the command to put in the macro to create the file name.

I need to have the file name auto-incremental depending on what name is
in the folder.

Could anyone also tell me how to create the file name as the current
date..

Thanks.

Reply »




All times are GMT +1. The time now is 08:20 AM.

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