View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
mike k mike k is offline
external usenet poster
 
Posts: 12
Default Worksheet_change event. <Small Problem

I just noticed a small problem. When I close the sheet and
reopen it. The time updates

Mike

-----Original Message-----
Since P5 is a calculated cell, I'd use the Calculate

event:

Put this in the worksheet code module

Public dOldP5 As Double

Private Sub Worksheet_Calculate()
With Range("P5")
If .Value < dOldP5 Then
With .Offset(0, 1)
.Value = Now
.NumberFormat = "dd mmm yyyy hh:mm:ss"
End With
dOldP5 = .Value
End If
End With
End Sub

Put this in the ThisWorkbook code module:

Private Sub Workbook_Open()
dOldP5 = Sheets(1).Range("P5").Value
End Sub

In article ,
"Mike K" wrote:

Basically if cell P5 (my lookup table is converting it
from a string to a number from 1-19) changes from

whatever
it was to ANYTHING else I need to record the time and

date
in another cell(say Q5). Then when it changes again

record
the new time and date in Q5

.