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

Tom,
Thanks, I figured that one out after some trial and
error. We just changed colors on our manufacturing line
and the time/date was captured as requested.
BTW Thanks again EVERYONE for the help. As usual the
resources in this group are wonderful. I am approached
here at work regularly for my Excel "expertise".

I must never reveal my secret...

Mike




-----Original Message-----
Combine the two. You can only have one.

--
Regards,
Tom Ogilvy

"Mike K" wrote in

message
...
Mr/Mrs McGimpsey,

The workbook_open event code is generating a compile

error:
Ambiguous name detected: Workbook_Open. I have another
open event on that page that sets calculate to auto.

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

.



.