Live Stock Data in Excel

T

Trader

I have a live stock market feed running into excel via DDE and it
updates intraday prices and volumes in the nominated row as trades
take place



Market Price Volume Time


FTSE100 3325 16 11.52



What I need to do is as the value changes in the row which is when a
trade takes place it records it in the next empty row eventually
creating a database.

If anyone can find the time for an answer it would be greatly
appreciated
 
D

Don Guillett

try this. It will insert a row after the active row if in col A
right click sheet tab>view code>insert this>save

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column <> 1 Then Exit Sub
Rows(Target.Row).Insert
End Sub
 
R

Richard Choate

The solution Don gave you has a downside. That solution inserts rows all the
time instead of just moving down the column to the next empty cell. Aren't
you just wanting to find the empty cell and make that cell "active" before
the program pastes the new data there?
Richard Choate


try this. It will insert a row after the active row if in col A
right click sheet tab>view code>insert this>save

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column <> 1 Then Exit Sub
Rows(Target.Row).Insert
End Sub
 
T

Trader

Richard Choate said:
The main issue is that it is inserting rows instead of just going to the
next cell down. I've noticed, also, that the OP has been silent for some
time now, so it is possible that he is not "tuning in" any more to read
these replies.
Richard


Assuming the data feed is into cell A1, a slight adjustment to Don
Guillett's code will cause the new row to be added only if new data comes
in:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Row <> 1 Or Target.Column <> 1 Then Exit Sub
If Target(1).Value = "" Then Exit Sub
Rows(Target.Row).Insert
End Sub



I am still around just different Time frame here in Australia so my
hours are different to yours. I appreciate the posting and will check
out the code. Many thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top