ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Rename workbook upon closing (https://www.excelbanter.com/excel-programming/313889-rename-workbook-upon-closing.html)

Brian

Rename workbook upon closing
 
Hi,
Can I have my workbook renamed upon closing and make the name the date which
is found in cell al of sheet named "patrol log". Two twists to this request
is that (1) I want to make the name consist of a constant "Patrol Log" with
the date from the a1 cell following, ex: Patrol Log 10-18-04. (2). I do not
want to have a save as request performed because that ends up keeping the
original workbook around, I want a rename request performed so that the
original is not saved.

I hope someone can help
Thank You,
Brian


Ron de Bruin

Rename workbook upon closing
 
Hi Brian

If you don't whant to save the orignal file you can do
a SaveCopyAs before closing

ActiveWorkbook.SaveCopyAs "Patrol Log " & Format(Now, "mm-dd-yy h-mm-ss") & ".xls"

Read Chip Pearson's site about Events
http://www.cpearson.com/excel/events.htm



--
Regards Ron de Bruin
http://www.rondebruin.nl


"Brian" wrote in message ...
Hi,
Can I have my workbook renamed upon closing and make the name the date which
is found in cell al of sheet named "patrol log". Two twists to this request
is that (1) I want to make the name consist of a constant "Patrol Log" with
the date from the a1 cell following, ex: Patrol Log 10-18-04. (2). I do not
want to have a save as request performed because that ends up keeping the
original workbook around, I want a rename request performed so that the
original is not saved.

I hope someone can help
Thank You,
Brian





All times are GMT +1. The time now is 12:40 PM.

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