Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA Code to save to 2 locations
I currently have code to save my workbook after running a couple o procedures. I would also like to save the workbook to another locatio as a backup on a different drive. Is it possible to save a workbook t multiple locations in the same code set? Below is the code I alread have. Sub moverange() x = Cells(Rows.Count, "A").End(xlUp).Row + 1 range(Cells(x, "A"), Cells(x + 0, "H")).Value range("New_Entry").Value range("New_Entry").Select Selection.Clearcontents range("A2").Select ActiveWorkbook.Save End Sub Thank you, Sinjin34 -- Sinjin34 ----------------------------------------------------------------------- Sinjin341's Profile: http://www.excelforum.com/member.php...fo&userid=1461 View this thread: http://www.excelforum.com/showthread.php?threadid=26882 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA Code to save to 2 locations
to save to the second location (this avoids changing the activeworkbook to
the backup copy) range("A2").Select ActiveWorkbook.Save Application.DisplayAlerts = False Activeworkbook.SaveCopyAs "C:\MyBackupFolder\" & ActiveWorkbook.Name Application.DisplayAlerts = True This overwrites a previous backup (with the same name) without prompt. -- Regards, Tom Ogilvy "Sinjin341" wrote in message ... I currently have code to save my workbook after running a couple of procedures. I would also like to save the workbook to another location as a backup on a different drive. Is it possible to save a workbook to multiple locations in the same code set? Below is the code I already have. Sub moverange() x = Cells(Rows.Count, "A").End(xlUp).Row + 1 range(Cells(x, "A"), Cells(x + 0, "H")).Value = range("New_Entry").Value range("New_Entry").Select Selection.Clearcontents range("A2").Select ActiveWorkbook.Save End Sub Thank you, Sinjin341 -- Sinjin341 ------------------------------------------------------------------------ Sinjin341's Profile: http://www.excelforum.com/member.php...o&userid=14616 View this thread: http://www.excelforum.com/showthread...hreadid=268820 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA Code to save to 2 locations
One way:
ActiveWorkbook.SaveCopyAs "C:\book2.xls" saves it as a backup copy and does not change the active file to a new filename. Robert Flanagan Macro Systems Delaware, U.S. 302-234-9857 http://www.add-ins.com Productivity add-ins and downloadable books on VB macros for Excel "Sinjin341" wrote in message ... I currently have code to save my workbook after running a couple of procedures. I would also like to save the workbook to another location as a backup on a different drive. Is it possible to save a workbook to multiple locations in the same code set? Below is the code I already have. Sub moverange() x = Cells(Rows.Count, "A").End(xlUp).Row + 1 range(Cells(x, "A"), Cells(x + 0, "H")).Value = range("New_Entry").Value range("New_Entry").Select Selection.Clearcontents range("A2").Select ActiveWorkbook.Save End Sub Thank you, Sinjin341 -- Sinjin341 ------------------------------------------------------------------------ Sinjin341's Profile: http://www.excelforum.com/member.php...o&userid=14616 View this thread: http://www.excelforum.com/showthread...hreadid=268820 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Save document to multiple locations | New Users to Excel | |||
save to multiple locations simultaneously | Excel Discussion (Misc queries) | |||
can you have excel automatically save in 2 locations | Excel Discussion (Misc queries) | |||
can you automatically save files to two different locations? | Excel Discussion (Misc queries) | |||
Is it possible to save an Excel file to 2 locations? | New Users to Excel |