View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Patrick Molloy Patrick Molloy is offline
external usenet poster
 
Posts: 1,049
Default Worksheet Change event

this is an FAQ , but anyway, add this code to the worksheets code page - to
get there , right click on the sheet tab and select View Code
we're using the CHANGE event -this fires every time a user enters new data.
We check to see if the changed cell is in the 'trigger' range - AJ13-AJ2000,
then put a time stamp in the next cell if it is....

Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Dim cell As Range
Set cell = Intersect(Target, Range("AJ13:AJ2000"))
If Not cell Is Nothing Then
With cell.Offset(, 1)
.Value = Now()
.NumberFormat = "dd/mm/yy HH:MM"
End With
End If
End Sub


"N1KO" wrote in message
...
I'm after a macro that'll place the date & time into a cell when another
cell
is changed from No to Yes.

I need the date to then be fixed (was thinking using a Now() function but
it'd change on every re-calculate) until the cell is changed again.

The Yes & No will be cells 13-2000 in column AJ & date/time in cells
13-2000
in column AK.

Naturally the cells in each column will relate (AJ13 changes then AK13
will
display the date, etc).

Thanks