AW: Einzelne Seite abspeichern
15.03.2005 11:51:04
Domke,
Hallo Volker,
den Tipp von Chris solltest Du nur nehmen, wenn Du in der Originalmappe die Tabellen 1 und 1 nicht brauchst!!! Ansonsten speichere die Datei erst unter einem neuen Namen und öffne diese zum Löschen der tabellen 1 und 2!
Ich mache so Backups:
Sub Backup()
Dim strBackup As String
Dim blnEnableEvents As Boolean
blnEnableEvents = Application.EnableEvents
Application.EnableEvents = False
If Workbooks.Count = 0 Then
MsgBox "Keine Arbeitsmappe offen!", vbExclamation
ElseIf ActiveWorkbook Is Nothing Then
MsgBox "Keine Arbeitsmappe aktiv!", vbExclamation
ElseIf ActiveWorkbook.Path = "" Then
MsgBox "Backup ""kann"" nur von einer gespeicherten Arbeitsmappe erfolgen!", vbExclamation
Else
strBackup = GetBackupName
On Error Resume Next
ActiveWorkbook.SaveCopyAs strBackup
If Err.Number = 0 Then _
MsgBox "Die Arbeitsmappe wurde unter dem Namen" & vbCr & strBackup & _
" gesichert!", vbInformation + vbOKOnly
End If
Application.EnableEvents = blnEnableEvents
End Sub
Function GetBackupName() As String
Dim strName As String
Dim strExt As String
Dim intLen As Integer
strExt = fGetFileExtension5(ActiveWorkbook.Name)
intLen = Len(ActiveWorkbook.Name) - Len(strExt)
If strExt <> "" Then
intLen = intLen - 1
Else
strExt = "xls"
End If
strName = Left(ActiveWorkbook.Name, intLen)
GetBackupName = ActiveWorkbook.Path & "\" & strName & _
Format(Now, " YYYY-MM-DD HH-MM-SS") & "." & strExt
End Function
Du musst jetzt nur noch per Makro die neue Arbeitsmappe öffnen und dann, wie oben beschrieben, die Tabellenblätter 1 und 2 löschen.
Viel Erfolg
Frank.