LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Worksheet_change event.

I need to record the time and date that a cell changes
states. It may change 1-2 times a day or it may not change
for 2-3 days. It's actually a string value but I
manipulated some logic to get it down to a true-false.
That worked in manual testing but not in field
conditions. I'm trying to capture a change in a PLC value
that feeds my worksheet, updating every 2 seconds. I have
a lookup table to simplify it to a number change now if
that helps.

I Have been banging on this for weeks now and I just can't
get to work. I don't have a deep enough programming
knowledge to make the correct modifications to the
worksheet_Change statement.

Below is what I had: (Got it from an earlier post in here)

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Set Target = Target(1)
If Not Intersect(Target, Range("P5")) Is Nothing Then
If Target.Value = 0 Then
With Target.Offset(0, 1)
.NumberFormat = "hh:mm AM/PM"
.Value = Time
End With
End If
End If
End Sub

What I need:

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

Hope I explained it clearly.
Win 2000
Excel 2000
Thanks,
Mike
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Worksheet_change event Dwayne Smith Excel Programming 2 June 5th 04 03:25 AM
Worksheet_Change Event cmcfalls[_4_] Excel Programming 3 April 12th 04 09:47 PM
worksheet_change event with a combo box ice_cool Excel Programming 3 February 13th 04 03:11 PM
Worksheet_Change Event Sam Excel Programming 2 November 21st 03 06:51 PM
xl97 and Worksheet_Change event ? Greg Wilson[_3_] Excel Programming 1 September 10th 03 04:17 AM


All times are GMT +1. The time now is 04:45 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"