I'm using the following workbook code to frequently save a timed and dated copy of the file in a backup location elsewhere before saving the file at it's normal location.
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Dim fn As String, ext As String, ipos As Long
ipos = InStr(Me.Name, ".")
fn = Left(Me.Name, ipos - 1)
ext = Right(Me.Name, Len(Me.Name) - ipos)
Application.StatusBar = " "
Me.SaveCopyAs "C:\Users\S\Documents\Backup\Excel" & fn & " " & Format(Now, "yyyy-mm-dd_hh_mm_ss") & "." & ext
Application.StatusBar = False
End Sub
However, in the workbook at E16 on a sheet that has the internal name of Sheet16 (as the sheet name is changed by me each month) I have a formula that inserts the current date and time.
What I would like to achieve somehow is that the cell value is saved not the formula but only on the backup copy.
I should mention that after I save the file I normally carry on working and may save a number of additional copies before I shut up shop for the day so it is not just a case of saving the backup copy after the working copy is saved
I hope that this makes sense
As always any help is much appreciated
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Dim fn As String, ext As String, ipos As Long
ipos = InStr(Me.Name, ".")
fn = Left(Me.Name, ipos - 1)
ext = Right(Me.Name, Len(Me.Name) - ipos)
Application.StatusBar = " "
Me.SaveCopyAs "C:\Users\S\Documents\Backup\Excel" & fn & " " & Format(Now, "yyyy-mm-dd_hh_mm_ss") & "." & ext
Application.StatusBar = False
End Sub
However, in the workbook at E16 on a sheet that has the internal name of Sheet16 (as the sheet name is changed by me each month) I have a formula that inserts the current date and time.
What I would like to achieve somehow is that the cell value is saved not the formula but only on the backup copy.
I should mention that after I save the file I normally carry on working and may save a number of additional copies before I shut up shop for the day so it is not just a case of saving the backup copy after the working copy is saved
I hope that this makes sense
As always any help is much appreciated