![]() |
Automate save and close
I need my workbook to save the changes and rename the file (to the name in cell A1) when I close the workbook ... is it possible to automate this? I use the workbook for invoice generation, cell A1 is the unique number and I have a clerk who keeps overwriting the previous file by simply answering "Yes" to the prompt "Do you want to save the changes" without renaming the file. Many thanks for your help Tony -- y_not ------------------------------------------------------------------------ y_not's Profile: http://www.excelforum.com/member.php...o&userid=19947 View this thread: http://www.excelforum.com/showthread...hreadid=523844 |
Automate save and close
You should make a master file for your data and always use Save As no Save. Or you can Save the data to press the key F12 and give a new name to that file. Hope this will help you. Dalip -- dalipsinghbisht ------------------------------------------------------------------------ dalipsinghbisht's Profile: http://www.excelforum.com/member.php...o&userid=32557 View this thread: http://www.excelforum.com/showthread...hreadid=523844 |
Automate save and close
One possibility is to use an auto start macro such as: Option Explicit Private Sub workbook_open() Dim fname As String fname = Sheets("sheet1").Range("a1").Value ActiveWorkbook.SaveAs _ Filename:=fname, _ FileFormat:=xlWorkbook, _ Password:="", _ WriteResPassword:="", _ ReadOnlyRecommended:=False, _ CreateBackup:=False End Sub This will save the file with the whatever name is in cell A1 every time it is opened. Ben -- protonLeah ------------------------------------------------------------------------ protonLeah's Profile: http://www.excelforum.com/member.php...o&userid=32097 View this thread: http://www.excelforum.com/showthread...hreadid=523844 |
All times are GMT +1. The time now is 01:31 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com