Thread: Date-time stamp
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Jacob Skaria Jacob Skaria is offline
external usenet poster
 
Posts: 8,520
Default Date-time stamp

For any changes done to unprotected area Range("A1:A20") a date/time stamp is
set in Column C which is the protected area. Right click the sheet tabView
Code and paste the below code to the code module..

Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
If Not Application.Intersect(Target, Range("A1:A20")) Is Nothing Then
If Target.Count = 1 Then
Me.Unprotect Password:="dist"
Range("C" & Target.Row) = Format(Now, "mmm dd, yyyy h:mm AMPM;@")
Me.Protect Password:="dist"
End If
End If
Application.EnableEvents = True
End Sub


If this post helps click Yes
---------------
Jacob Skaria


"Daniel" wrote:

Hello,

My name is Daniel,
Can you please help me with some code to do the following in Excel:

Have one spreadsheet (with some protection I think); whenever someone
alters the content of some cells, a DateTime stamp should be stored in another
cell (protected).

Thank you