Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
DP7 DP7 is offline
external usenet poster
 
Posts: 54
Default Please help macro for save

I think a macro is the best way to do this; if there is a way that is better
I am open to all suggestions. I am trying to create a backup copy of one of
my spreadsheets on a daily basis. I need this to be done every weekday night
@ around 11PM when I know all updates for that day should be done. I need the
file name to contain the date from that day. So far I have the macro below as
my starting point. I have tried doing different things to get what I want; I
have had varying degrees of success. If anyone has any ideas as to how I
should attack this I would be very grateful.
Thanks in advance.




Sub Saveas()
'
' Saveas Macro
' Macro recorded 10/11/2007 by
'

'
ChDir _
"R:\Production Reports\Production Summary Report\Daily Production
Summary Copies"
ActiveWorkbook.Saveas Filename:= _
"R:\Production Reports\Production Summary Report\Daily Production
Summary Copies\Book1.xls" _
, FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
End Sub

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,856
Default Please help macro for save

When you record a macro you often get things you don't really need.
Here you change the directory, so you don't need the full path in the
SaveAs command.

Anyway, do you really want to save it as Book1 (with a date added)? If
so, then you can try this:

ActiveWorkbook.Saveas Filename:= _
"Book1" & Format(Date, "yymmdd") & ".xls", _
FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False

Note the changes following "Book 1" on the second line. You might want
to change the format string.

Hope this helps.

Pete

On Oct 11, 9:20 pm, DP7 wrote:
I think a macro is the best way to do this; if there is a way that is better
I am open to all suggestions. I am trying to create a backup copy of one of
my spreadsheets on a daily basis. I need this to be done every weekday night
@ around 11PM when I know all updates for that day should be done. I need the
file name to contain the date from that day. So far I have the macro below as
my starting point. I have tried doing different things to get what I want; I
have had varying degrees of success. If anyone has any ideas as to how I
should attack this I would be very grateful.
Thanks in advance.

Sub Saveas()
'
' Saveas Macro
' Macro recorded 10/11/2007 by
'

'
ChDir _
"R:\Production Reports\Production Summary Report\Daily Production
Summary Copies"
ActiveWorkbook.Saveas Filename:= _
"R:\Production Reports\Production Summary Report\Daily Production
Summary Copies\Book1.xls" _
, FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
End Sub



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
Macro to Save without the Save Message Ellen G Excel Discussion (Misc queries) 4 February 23rd 07 09:52 PM
Save as Macro MikeD1224 Excel Discussion (Misc queries) 1 February 17th 07 12:08 AM
Macro Save As John Excel Discussion (Misc queries) 1 June 1st 06 01:44 PM
Save a Macro ducttape Excel Discussion (Misc queries) 3 February 20th 06 05:46 PM
Macro to save John Excel Worksheet Functions 2 April 29th 05 01:38 AM


All times are GMT +1. The time now is 07:53 AM.

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

About Us

"It's about Microsoft Excel"