Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
carl
 
Posts: n/a
Default Capturing First Change In A Cell

I started this question yesterday.

I monitoring the opening times of stocks. The TIME field is fed by a DDE
link. In the morning before the trading day starts the table looks like this:

Stock TIME
QQQQ-O 12/17/2005
AAPL-O 12/17/2005
GOOG-O 12/17/2005
CSCO-O 12/17/2005

When the stock does it's first trade, I want to record that value. The
problem is that the time is changing continuously - asnd I only want to
record the first change - for example, the table below shows the instant that
the TIME value changes from "12/17/2006" to a time. It is this change that I
am trying to record.


Stock TIME
QQQQ-O 9:31
AAPL-O 9:31
GOOG-O 9:33
CSCO-O 9:34

One of the participants in this forum suggest the use of the follwoing code:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column < 3 Then Exit Sub
If IsEmpty(Range("F1")) Then _
Range("F1").Value = Target.Value
End Sub

I could not get this to work.

I appreciate any suggestions.

Thank you in advance.



  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
vezerid
 
Posts: n/a
Default Capturing First Change In A Cell

I have not seen the original suggestion but IsEmpty tests for
uninitialized variables and not for an empty cell. The following should
(could) work:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column < 3 Then Exit Sub
If Range("F1") = "" Then Range("F1").Value = Target.Value
End Sub

HTH
Kostis Vezerides

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
carl
 
Posts: n/a
Default Capturing First Change In A Cell

Thank you. Will this work for each row - not just for F1 ?

"vezerid" wrote:

I have not seen the original suggestion but IsEmpty tests for
uninitialized variables and not for an empty cell. The following should
(could) work:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column < 3 Then Exit Sub
If Range("F1") = "" Then Range("F1").Value = Target.Value
End Sub

HTH
Kostis Vezerides


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Otto Moehrbach
 
Posts: n/a
Default Capturing First Change In A Cell

Carl
As written, that macro works with F1 only. Post back and detail what
you want to happen and for how many cells you want this to happen. HTH
Otto
"carl" wrote in message
...
Thank you. Will this work for each row - not just for F1 ?

"vezerid" wrote:

I have not seen the original suggestion but IsEmpty tests for
uninitialized variables and not for an empty cell. The following should
(could) work:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column < 3 Then Exit Sub
If Range("F1") = "" Then Range("F1").Value = Target.Value
End Sub

HTH
Kostis Vezerides




  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
carl
 
Posts: n/a
Default Capturing First Change In A Cell

Thanks Otto. Here's my question again. I need to record the first change
(only) from the date to the time an all rows. Presently my list has 164
stocks.

I monitoring the opening times of stocks. The TIME field is fed by a DDE
link. In the morning before the trading day starts the table looks like this:

Stock TIME
QQQQ-O 12/17/2005
AAPL-O 12/17/2005
GOOG-O 12/17/2005
CSCO-O 12/17/2005

When the stock does it's first trade, I want to record that value. The
problem is that the time is changing continuously - asnd I only want to
record the first change - for example, the table below shows the instant that
the TIME value changes from "12/17/2006" to a time. It is this change that I
am trying to record.


Stock TIME
QQQQ-O 9:31
AAPL-O 9:31
GOOG-O 9:33
CSCO-O 9:34


"Otto Moehrbach" wrote:

Carl
As written, that macro works with F1 only. Post back and detail what
you want to happen and for how many cells you want this to happen. HTH
Otto
"carl" wrote in message
...
Thank you. Will this work for each row - not just for F1 ?

"vezerid" wrote:

I have not seen the original suggestion but IsEmpty tests for
uninitialized variables and not for an empty cell. The following should
(could) work:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column < 3 Then Exit Sub
If Range("F1") = "" Then Range("F1").Value = Target.Value
End Sub

HTH
Kostis Vezerides







Reply
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
I Need a formula to evaluate a cell with + or - values Bob in Oklahoma Excel Worksheet Functions 6 October 31st 05 02:41 PM
Cell Change Color - Need Help alani New Users to Excel 3 June 29th 05 03:50 PM
Possible Lookup Table Karen Excel Worksheet Functions 5 June 8th 05 09:43 PM
background color of my cell does not change Colorblinded Excel Discussion (Misc queries) 2 March 27th 05 04:55 PM
Look for change next blank cell in Range Nigel Bennett Excel Worksheet Functions 1 March 13th 05 09:45 PM


All times are GMT +1. The time now is 09:15 PM.

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"