Lee
This macro does what you want if I am reading you correctly. As
written, this macro assumes and does as follows:
The date that gets changed is in A1.
On the same sheet, C2 and D2 will display the number of times the date has
been changed and the total number of days slipped, respectively.
There must be a sheet named "Utility".
In the Utility sheet, row 1 is for the column headers.
In the first empty row of the Utility sheet, this macro will place the date
and time of the current change of date in Column A, and the number of days
slipped in Column B.
Note that this macro must be placed in the sheet module of the sheet that
contains the changed date in A1. To access that module, right-click on the
sheet tab, select View Code, and paste this macro into the displayed module.
"X" out of the module to return to your sheet.
If you wish, send me an email and I'll send you the small file I used to
develop this code. HTH Otto
Private Sub Worksheet_Change(ByVal Target As Range)
Dim OldDate As Date
Dim NewDate As Date
Dim RngColAUtil As Range
If Target.Count > 1 Then Exit Sub
If IsEmpty(Target.Value) Then Exit Sub
If Target.Address(0, 0) = "A1" Then
Application.ScreenUpdating = False
NewDate = Target.Value
Application.EnableEvents = False
Application.Undo
OldDate = Range("A1").Value
Range("A1").Value = NewDate
With Sheets("Utility")
.Range("A" & Rows.Count).End(xlUp).Offset(1).Value = Now
Set RngColAUtil = .Range("A2", .Range("A" &
Rows.Count).End(xlUp))
RngColAUtil(RngColAUtil.Count).Offset(, 1) = NewDate - OldDate
End With
[C2].Value = RngColAUtil.Count
[D2].Value = Application.Sum(RngColAUtil.Offset(, 1))
Application.EnableEvents = True
Application.ScreenUpdating = True
End If
End Sub
Lee said:
Thanks, some more details are
I am interested in tracking how many times they slip a date they have
originally committed to. It sounds like using Worksheet_Change event
might
do the job. What I would really like to show from that data is to have
two
other cells in the same worksheet display 1) the number of times they have
changed the date i.e. 1,2,3 etc., and 2) the total slip in days from the
original date they entered in the workbook.