Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Automatic Save As
I have a spread sheet which I would like to save as the value in Cell A1 -
see below. A B 1Stage No 18 - Sat, Nov 19, 2005 2 3 The Stage No 'X' is generated by a workbook_open sub, and I would just like to close the book if possible and save it as the value of A1. Is it possible? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Automatic Save As
Activeworkbook.SaveAs Filename:=Activesheet.Range("A1").Value -- HTH RP (remove nothere from the email address if mailing direct) "Sandy" wrote in message ... I have a spread sheet which I would like to save as the value in Cell A1 - see below. A B 1Stage No 18 - Sat, Nov 19, 2005 2 3 The Stage No 'X' is generated by a workbook_open sub, and I would just like to close the book if possible and save it as the value of A1. Is it possible? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Automatic Save As
Hi Bob
Excellent. But...Sorry to be a pest.... Having saved as the the workbook is suitably renamed however it is intended as a record, but when I open it up for say, printing, the code runs to update my stage no and then on closing saves as another sheet. Is there any way to be able to open and close it after initial save as and not have the code running. Sandy "Bob Phillips" wrote in message ... Activeworkbook.SaveAs Filename:=Activesheet.Range("A1").Value -- HTH RP (remove nothere from the email address if mailing direct) "Sandy" wrote in message ... I have a spread sheet which I would like to save as the value in Cell A1 - see below. A B 1Stage No 18 - Sat, Nov 19, 2005 2 3 The Stage No 'X' is generated by a workbook_open sub, and I would just like to close the book if possible and save it as the value of A1. Is it possible? |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Automatic Save As
You would need to delete the code from that workbook, and to do that you
need to have the deleting code somewhere else. Assuming that you - open workbook - do stuff - saveas some other name I cannot see where you would store that code. -- HTH RP (remove nothere from the email address if mailing direct) "Sandy" wrote in message ... Hi Bob Excellent. But...Sorry to be a pest.... Having saved as the the workbook is suitably renamed however it is intended as a record, but when I open it up for say, printing, the code runs to update my stage no and then on closing saves as another sheet. Is there any way to be able to open and close it after initial save as and not have the code running. Sandy "Bob Phillips" wrote in message ... Activeworkbook.SaveAs Filename:=Activesheet.Range("A1").Value -- HTH RP (remove nothere from the email address if mailing direct) "Sandy" wrote in message ... I have a spread sheet which I would like to save as the value in Cell A1 - see below. A B 1Stage No 18 - Sat, Nov 19, 2005 2 3 The Stage No 'X' is generated by a workbook_open sub, and I would just like to close the book if possible and save it as the value of A1. Is it possible? |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Automatic Save As
Hi Bob
Found a workaround:- Private Sub Workbook_Open() If Sheet1.Range("A15") = 1 Then Sheet1.Range("A5").Value = Sheet1.Range("A5").Value + 1 End If End Sub Private Sub Workbook_BeforeClose(Cancel As Boolean) If Sheet1.Range("A15").Value = 1 Then ActiveWorkbook.Save ActiveWorkbook.SaveAs Filename:= Sheet1.Range("A1").Value End If Sheet1.Range("A15").Value = 2 End Sub Sandy "Bob Phillips" wrote in message ... You would need to delete the code from that workbook, and to do that you need to have the deleting code somewhere else. Assuming that you - open workbook - do stuff - saveas some other name I cannot see where you would store that code. -- HTH RP (remove nothere from the email address if mailing direct) "Sandy" wrote in message ... Hi Bob Excellent. But...Sorry to be a pest.... Having saved as the the workbook is suitably renamed however it is intended as a record, but when I open it up for say, printing, the code runs to update my stage no and then on closing saves as another sheet. Is there any way to be able to open and close it after initial save as and not have the code running. Sandy "Bob Phillips" wrote in message ... Activeworkbook.SaveAs Filename:=Activesheet.Range("A1").Value -- HTH RP (remove nothere from the email address if mailing direct) "Sandy" wrote in message ... I have a spread sheet which I would like to save as the value in Cell A1 - see below. A B 1Stage No 18 - Sat, Nov 19, 2005 2 3 The Stage No 'X' is generated by a workbook_open sub, and I would just like to close the book if possible and save it as the value of A1. Is it possible? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Automatic save as for CSV | Excel Discussion (Misc queries) | |||
Where does Save As Automatic Backup save its files? | Excel Discussion (Misc queries) | |||
Automatic Save As Macro | Excel Discussion (Misc queries) | |||
Automatic Save As | Excel Discussion (Misc queries) | |||
Automatic Save and Exit | Excel Discussion (Misc queries) |