want to record date for each time I update a file - Excel 2007

P

PattyR

I want to keep track of dates that a file is updated.
The Summary only shows the last time a file was modified but I want to keep
track of each time it is modified.
Is there a way to do this?
I have MS Office Enterprise 2007.
Thanks
Patty
 
S

smartin

PattyR said:
I want to keep track of dates that a file is updated.
The Summary only shows the last time a file was modified but I want to keep
track of each time it is modified.
Is there a way to do this?
I have MS Office Enterprise 2007.
Thanks
Patty

I dug up this code (can't recall where I got the original idea). The
functionality here is a save event will silently capture the user and
timestamp, and write the aforementioned to a worksheet called "SAVE"
(which you must create in the workbook beforehand, and hide if desired).

I can upload a workbook that demonstrates this if you like.

Watch for line-wrap:

THISWORKBOOK.CODE>>

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
Dim lastrow As Range
Static IgnoreSave As Boolean

If Not IgnoreSave Then
With ThisWorkbook
With Worksheets("SAVE")
Set lastrow = .Cells(Rows.Count, 1).End(xlUp) _
.Offset(1, 0)
lastrow.Value = "Saved By " _
& Environ("UserName") & " " & Now
End With
IgnoreSave = True
.Save
IgnoreSave = False
End With
End If
End Sub

END CODE<<
 
P

PattyR

I dug up this code (can't recall where I got the original idea). The
functionality here is a save event will silently capture the user and
timestamp, and write the aforementioned to a worksheet called "SAVE"
(which you must create in the workbook beforehand, and hide if desired).

I can upload a workbook that demonstrates this if you like.

Watch for line-wrap:

THISWORKBOOK.CODE>>

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
Dim lastrow As Range
Static IgnoreSave As Boolean

If Not IgnoreSave Then
With ThisWorkbook
With Worksheets("SAVE")
Set lastrow = .Cells(Rows.Count, 1).End(xlUp) _
.Offset(1, 0)
lastrow.Value = "Saved By " _
& Environ("UserName") & " " & Now
End With
IgnoreSave = True
.Save
IgnoreSave = False
End With
End If
End Sub

END CODE<<

Hi
Could you please tell me where to enter the code? I've never dealth with
macros in Excel before.
Thanks
Patty
 
Top