Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default How do I save/update work to appear in 2 seperate files?

Each time I save my work I want it to save to two seperate files, without
having to cut and paste the new version across each time. Is this possible?
The shared drive and to my computer.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,942
Default How do I save/update work to appear in 2 seperate files?

hi
yes it is. you request is not uncommon. lots of people want to create a
backup as they work. the solution is a duel save. the code i am about to
paste is workbook level code meaning that you will have to paste in a
thisworkbook module. you will also have to replace my file paths with your
file paths. post back if you need further help.

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Application.DisplayAlerts = False
ChDir "E:\Excel\CodeStuff"
ActiveWorkbook.SaveAs Filename:="E:\Excel\CodeStuff\deleteme.xls", _
FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
ChDir "C:\Program Files\Microsoft Office\Office10\XLStart"
ActiveWorkbook.SaveAs Filename:= _
"C:\Documents and settings\deleteme.xls", FileFormat _
:=xlNormal, Password:="", WriteResPassword:="",
ReadOnlyRecommended:= _
False, CreateBackup:=False
Application.DisplayAlerts = True
End Sub

rergards
FSt1
"Dodeka1" wrote:

Each time I save my work I want it to save to two seperate files, without
having to cut and paste the new version across each time. Is this possible?
The shared drive and to my computer.

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,593
Default How do I save/update work to appear in 2 seperate files?

Caters for both Save and SaveAs

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
Dim sFile
Application.EnableEvents = False
Cancel = True
If SaveAsUI Then
sFile = Application.GetOpenFilename("Excel Files (*.xls), *.xls")
If sFile < False Then
With ThisWorkbook
.SaveAs sFile
.SaveCopyAs .Path & Application.PathSeparator & _
Left(.Name, InStrRev(.Name, ".") - 1) & "_Backup"
End With
End If
Else
With ThisWorkbook
.Save sFile
.SaveCopyAs .Path & Application.PathSeparator & _
Left(.Name, InStrRev(.Name, ".") - 1) & "_Backup"
End With
End If
Application.EnableEvents = True
End Sub


--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Dodeka1" wrote in message
...
Each time I save my work I want it to save to two seperate files, without
having to cut and paste the new version across each time. Is this
possible?
The shared drive and to my computer.



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
save worksheets as seperate files (I know how to do it one by one) SANCAKLI Excel Discussion (Misc queries) 2 April 4th 07 01:39 PM
Save worksheet to seperate file? George Excel Discussion (Misc queries) 4 October 30th 06 08:30 PM
validation lists from seperate work books paul Excel Discussion (Misc queries) 0 March 26th 06 11:46 PM
how do I save the files automatically when I work in 2000 version Jenny Ma Excel Discussion (Misc queries) 1 January 5th 06 11:47 AM
want to create a template and update in seperate worksheet lata New Users to Excel 0 February 23rd 05 07:21 AM


All times are GMT +1. The time now is 05:12 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"