Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
exporting a worksheet for backup
I would like to export the last worksheet in my workbook into a backu
dir. How can I do this without doing "Copy Worksheet" where it opens u in the new work book? I would just like it to export while keeping onl the current workbook open. Thanks in advance, Mik -- Message posted from http://www.ExcelForum.com |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
exporting a worksheet for backup
this dose not do exactly what your asking, it saves the
whole file to a bu directory, adjust it to fit your needs Sub CreateBackUp() 'need to creat the folder Bu if not their Dim Num As Integer Dim OrgPathSt As String Const BUPath As String = "C:\BU\" Dim BUPathName As String Dim Wb As Workbook On Error GoTo CreateDir Application.ScreenUpdating = False Set Wb = ActiveWorkbook OrgPathSt = Wb.Path & "\" & Wb.Name If Left(OrgPathSt, 1) = "\" Then MsgBox "You must name & save your file first, Via 'File' then 'Save As'" Exit Sub End If BUPathName = "C:\BU\" & Left(Wb.Name, Len(Wb.Name) - 4) & _ " (" & Year(Date) & "-" & Month(Date) & "-" & Day (Date) & " " & Hour(Time) & "." & Minute(Time) & "." & Second(Time) & ")" & ".xls" Num = MsgBox("Do you wish to save the Current file as:" & vbNewLine & "[ " & OrgPathSt & " ]" _ & vbNewLine & vbNewLine & "And Create the Backup File:" & vbNewLine & "[ " & BUPathName & " ]", vbOKCancel, "Back Up") If Num = vbCancel Then Exit Sub Wb.Save SaveAsBu: Wb.SaveAs FileName:=BUPathName Wb.Close Workbooks.Open FileName:=OrgPathSt Application.ScreenUpdating = True Exit Sub CreateDir: MkDir "BU" GoTo SaveAsBu End Sub |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
exporting a worksheet for backup
I doubt you can, but you can make the action not visible
Application.ScreenUpdating = False worksheets(worksheets.count).Copy Application.DisplayAlerts = False ActiveWorkbook.SaveAs "C:\myfolder\myfile.xls" Application.DisplayAlerts = True ActiveWorkbook.Close SaveChanges:=False Application.ScreenUpdating = True -- Regards, Tom Ogilvy "sp00nix " wrote in message ... I would like to export the last worksheet in my workbook into a backup dir. How can I do this without doing "Copy Worksheet" where it opens up in the new work book? I would just like it to export while keeping only the current workbook open. Thanks in advance, Mike --- Message posted from http://www.ExcelForum.com/ |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
exporting a worksheet for backup
Thanks, I have made similar code but my original question kind of
stumped me. Anyone have any other ideas? Mike --- Message posted from http://www.ExcelForum.com/ |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
exporting a worksheet for backup
One reason I didn't want to copy the ws to a new wb is because it won'
copy the complete cell if it has more than 255 chars. Is there any wa around this issue? Thank -- Message posted from http://www.ExcelForum.com |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
exporting a worksheet for backup
Dim rng as Range
Application.ScreenUpdating = False set rng = worksheets(worksheet.count).Cells worksheets(worksheets.count).Copy rng.copy Destination:=Activesheet.Cells Application.DisplayAlerts = False ActiveWorkbook.SaveAs "C:\myfolder\myfile.xls" Application.DisplayAlerts = True ActiveWorkbook.Close SaveChanges:=False Application.ScreenUpdating = True -- Regards, Tom Ogilvy "Tom Ogilvy" wrote in message ... I doubt you can, but you can make the action not visible Application.ScreenUpdating = False worksheets(worksheets.count).Copy Application.DisplayAlerts = False ActiveWorkbook.SaveAs "C:\myfolder\myfile.xls" Application.DisplayAlerts = True ActiveWorkbook.Close SaveChanges:=False Application.ScreenUpdating = True -- Regards, Tom Ogilvy "sp00nix " wrote in message ... I would like to export the last worksheet in my workbook into a backup dir. How can I do this without doing "Copy Worksheet" where it opens up in the new work book? I would just like it to export while keeping only the current workbook open. Thanks in advance, Mike --- Message posted from http://www.ExcelForum.com/ |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
exporting a worksheet for backup
One way might be to delete all but the last worksheet and saveas
-- Don Guillett SalesAid Software "sp00nix " wrote in message ... I would like to export the last worksheet in my workbook into a backup dir. How can I do this without doing "Copy Worksheet" where it opens up in the new work book? I would just like it to export while keeping only the current workbook open. Thanks in advance, Mike --- Message posted from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Searching worksheet and exporting name to other sheet | Excel Discussion (Misc queries) | |||
Exporting into a Worksheet | Excel Discussion (Misc queries) | |||
exporting worksheet to access | Excel Discussion (Misc queries) | |||
exporting excel worksheet to word | Links and Linking in Excel | |||
why there is a backup copy for excel worksheet? | Excel Discussion (Misc queries) |