Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 270
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 270
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 270
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Automatic save as for CSV Carrie_Loos via OfficeKB.com Excel Discussion (Misc queries) 2 April 29th 10 11:44 PM
Where does Save As Automatic Backup save its files? JoAnn Excel Discussion (Misc queries) 3 April 4th 08 08:48 PM
Automatic Save As Macro wrvadmin Excel Discussion (Misc queries) 3 January 23rd 08 05:48 PM
Automatic Save As gramps Excel Discussion (Misc queries) 2 April 4th 07 04:46 PM
Automatic Save and Exit duane Excel Discussion (Misc queries) 1 July 18th 06 10:32 AM


All times are GMT +1. The time now is 10:28 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"