ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Automatic Save As (https://www.excelbanter.com/excel-programming/346047-automatic-save.html)

Sandy

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?



Bob Phillips[_6_]

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?





Sandy

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?







Bob Phillips[_6_]

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?









Sandy

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?












All times are GMT +1. The time now is 02:42 AM.

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