Reminder for backup

B

Bob

I have a macro which creates a backup of my workbook.

I now need a macro which will display a message if that
backup macro has not been run within say the last 7 days.
Can this be done with VBA?

Thanks
 
C

Charles

Bob,

Try something like this.

Sub Lastruntime()
Application.ScreenUpdating = False
Worksheets("sheet1").Activate
If Range("a2").Value <= Date - 7 Then<< this sets the nr of days
MsgBox "Last Backup was on: " & Range("a2").Value
End If
End Sub

after backup is done set Range("A2"). Value = Date

HTH

Charle
 
T

Tom Ogilvy

Application.Displayalerts = False
Thisworkbook.SaveCopyAs _
filename:="C:\MyBackups\ & thisworkbook.Name
Application.displaAlerts = True
 
Top