close
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-O12/17/2005
AAPL-O12/17/2005
GOOG-O12/17/2005
CSCO-O12/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 quot;12/17/2006quot; to a time. It is this change that I
am trying to record.Stock TIME
QQQQ-O9:31
AAPL-O9:31
GOOG-O9:33
CSCO-O9: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 lt;gt; 3 Then Exit Sub
If IsEmpty(Range(quot;F1quot;)) Then _
Range(quot;F1quot;).Value = Target.Value
End Sub

I could not get this to work.

I appreciate any suggestions.

Thank you in advance.

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 lt;gt; 3 Then Exit Sub
If Range(quot;F1quot;) = quot;quot; Then Range(quot;F1quot;).Value = Target.Value
End Sub

HTH
Kostis VezeridesThank you. Will this work for each row - not just for F1 ?

quot;vezeridquot; wrote:

gt; I have not seen the original suggestion but IsEmpty tests for
gt; uninitialized variables and not for an empty cell. The following should
gt; (could) work:
gt;
gt; Private Sub Worksheet_Change(ByVal Target As Range)
gt; If Target.Column lt;gt; 3 Then Exit Sub
gt; If Range(quot;F1quot;) = quot;quot; Then Range(quot;F1quot;).Value = Target.Value
gt; End Sub
gt;
gt; HTH
gt; Kostis Vezerides
gt;
gt;

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
quot;carlquot; gt; wrote in message
...
gt; Thank you. Will this work for each row - not just for F1 ?
gt;
gt; quot;vezeridquot; wrote:
gt;
gt;gt; I have not seen the original suggestion but IsEmpty tests for
gt;gt; uninitialized variables and not for an empty cell. The following should
gt;gt; (could) work:
gt;gt;
gt;gt; Private Sub Worksheet_Change(ByVal Target As Range)
gt;gt; If Target.Column lt;gt; 3 Then Exit Sub
gt;gt; If Range(quot;F1quot;) = quot;quot; Then Range(quot;F1quot;).Value = Target.Value
gt;gt; End Sub
gt;gt;
gt;gt; HTH
gt;gt; Kostis Vezerides
gt;gt;
gt;gt;
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 quot;12/17/2006quot; 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:34quot;Otto Moehrbachquot; wrote:

gt; Carl
gt; As written, that macro works with F1 only. Post back and detail what
gt; you want to happen and for how many cells you want this to happen. HTH
gt; Otto
gt; quot;carlquot; gt; wrote in message
gt; ...
gt; gt; Thank you. Will this work for each row - not just for F1 ?
gt; gt;
gt; gt; quot;vezeridquot; wrote:
gt; gt;
gt; gt;gt; I have not seen the original suggestion but IsEmpty tests for
gt; gt;gt; uninitialized variables and not for an empty cell. The following should
gt; gt;gt; (could) work:
gt; gt;gt;
gt; gt;gt; Private Sub Worksheet_Change(ByVal Target As Range)
gt; gt;gt; If Target.Column lt;gt; 3 Then Exit Sub
gt; gt;gt; If Range(quot;F1quot;) = quot;quot; Then Range(quot;F1quot;).Value = Target.Value
gt; gt;gt; End Sub
gt; gt;gt;
gt; gt;gt; HTH
gt; gt;gt; Kostis Vezerides
gt; gt;gt;
gt; gt;gt;
gt;
gt;
gt;

arrow
arrow
    全站熱搜

    software 發表在 痞客邦 留言(0) 人氣()