Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
save worksheets as seperate files (I know how to do it one by one) | Excel Discussion (Misc queries) | |||
Save worksheet to seperate file? | Excel Discussion (Misc queries) | |||
validation lists from seperate work books | Excel Discussion (Misc queries) | |||
how do I save the files automatically when I work in 2000 version | Excel Discussion (Misc queries) | |||
want to create a template and update in seperate worksheet | New Users to Excel |