ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Autosaving an Excel Workbooks as versions (https://www.excelbanter.com/excel-discussion-misc-queries/123013-autosaving-excel-workbooks-versions.html)

Doctorjones_md

Autosaving an Excel Workbooks as versions
 
I'm wondering -- is there a way to automate saving an Excel Workbook whereas
you could (for example):

You open an Excel template, and save it as C:\Temp\Test.xls -- then if you
reopen (and modify) C:\Temp\Test.xls, the VBA code will search the
directory and automatically affix an _a, _b, _c, _d, ... to the end of the
file name (ie. C:\Temp\Test_d.xls -- if the last file saved was
C:\Temp\Test_c.xls).

Thanks in advance



Jim Cone

Autosaving an Excel Workbooks as versions
 
Use "SaveAs" on the File menu instead of "Save".
The open workbook will be closed and a new version saved under
the name you assign... "Test_a.xls"
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware


"Doctorjones_md"

wrote in message
I'm wondering -- is there a way to automate saving an Excel Workbook whereas
you could (for example):
You open an Excel template, and save it as C:\Temp\Test.xls -- then if you
reopen (and modify) C:\Temp\Test.xls, the VBA code will search the
directory and automatically affix an _a, _b, _c, _d, ... to the end of the
file name (ie. C:\Temp\Test_d.xls -- if the last file saved was
C:\Temp\Test_c.xls).

Thanks in advance



kassie

Autosaving an Excel Workbooks as versions
 
You could write a macro to take care of it for you. Where you put the macro
will depend on when you want to do the save - at file open, before close or
when.
You would most likely have to insert the current version value in some cell,
where it does not interfere with your data, eg around IA1 or around there.
Most likely you will have to use figures, rather than letters.

The macro would every time add 1 to this value, and read it into a variable.
You could use a constant, which will house your original file name, without
the ".xls", eg C:\Temp\Test.
When you do the File SaveAs bit, concatenate the constant with the varable
and ".xls", eg cFname & vVer & ".xls"
--
Hth

Kassie Kasselman


"Doctorjones_md" wrote:

I'm wondering -- is there a way to automate saving an Excel Workbook whereas
you could (for example):

You open an Excel template, and save it as C:\Temp\Test.xls -- then if you
reopen (and modify) C:\Temp\Test.xls, the VBA code will search the
directory and automatically affix an _a, _b, _c, _d, ... to the end of the
file name (ie. C:\Temp\Test_d.xls -- if the last file saved was
C:\Temp\Test_c.xls).

Thanks in advance





All times are GMT +1. The time now is 01:11 AM.

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