Formula changes do not generate Change events... the cells they are
dependent on do that. There is a way to program for that, but the layout of
your worksheet will dictate how to approach it. Let me give you a simple
example and then show you where the complication could come in... hopefully
this will be enough for you to see how to apply it to your particular
layout.
On a new worksheet, put this formula in D3...
=IF(A1="","Nothing","Something")
Now put this code in that worksheet's code window...
Private Sub Worksheet_Change(ByVal Target As Range)
On Error Resume Next 'Needed for when there are no dependents
If Not Intersect(Target.Dependents, Range("D1

10")) Is Nothing Then
Target.Dependents.Offset(0, 1).Value = Now
End If
End Sub
Go back to the worksheet and change the value in A1. When you do that, the
date/time is placed in the column next to the formula that refers to A1.
This seems to do what you asked. Now, for the complication. Erase the
date/time that was placed in E3 and add this formula in D5...
=A1<>""
Now, there are two different formulas referencing A1. Change the value in
A1. Notice that date/times are now placed next to **both** formulas. This is
what I meant by needing to know your layout... if you have this multiple
reference to the same source cell, you might need additional filtering code
of some kind to lock down which cell gets the date/time place in it (I'm
thinking this would be data/structural layout dependent).
Anyway, I think the Dependents property of the Target range is what you will
need to work with... hopefully the above has been of some help.
--
Rick (MVP - Excel)
Jock said:
Hi Rick,
As a basic scenario, cells in A, B and C are 'summary' cells and have
formulae in them which are date driven and will display "W" in A, "Str" in
B
and "Sty" in C when certain conditions are met elsewhere in the sheet.
So when something does appear in any or all of A, B, C in any row, I want
the date that it appeared to be placed on the same row but offset by (0,
44).
This works (using the Worksheet_Change code below) when "W" for instance
is
placed in A. However, when "W" appears as the result of a formula, nothing
happens.
code:
On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range("A4:C10000")) Is Nothing Then
With Target
If .Value <> "" Then
.Offset(0, 44).Value = Format(Date, "dd/mmm")
End If
End With
End If
How can this be adapted to act when something appears in A:C to place the
date 44 cells along?
Could a simple formula be used in the cells 44 along rather than use code?