VBA · Administration

Zeitgestempelte Sicherungskopie der Arbeitsmappe

Erzeugt neben der geöffneten Datei eine Sicherungskopie mit Datum und Uhrzeit.

VBA
Sub SicherungskopieErstellen()
    If ThisWorkbook.Path = "" Then
        MsgBox "Bitte die Arbeitsmappe zuerst speichern.", vbExclamation
        Exit Sub
    End If
    Dim ziel As String
    ziel = ThisWorkbook.Path & "\Backup_" & Format(Now, "yyyymmdd_hhnnss") & "_" & ThisWorkbook.Name
    ThisWorkbook.SaveCopyAs ziel
    MsgBox "Sicherung erstellt:" & vbCrLf & ziel, vbInformation
End Sub
VBAExcelBackupSicherung
WA