Hi Jon
Thanks for your post.
On re-reading my post, I realise that it might have been a bit oblique ,
sorry! Being a newbie, I'm not sure what to include/exclude in my posts.
Yes there is an error in VBA; and no it is not an error in your dynamic
formula.
Like I said in my earlier post, "I think the data is coming in too fast as
its fine if I manually input dummy data into the range."
FYI
Data arrives on Sheet A from a server with a page layout I have to adapt to
work with. Originally, I tried to just copy/paste every second on to Row 2 of
Sheet B but the screen flickered too much and when I tried to plot a chart I
got a VBA error, "late binding", I think it was, (I don't have the code here,
it's on a different PC).
So I rewrote the subs to set a link between Sheets A & B, taking the data
and setting it out in Row 2, underneath column headings . I then used an
array, linked to an OnTime call firing every second, to write the values to
the next empty row.
I read about the defined name in John Walkenbach's 2003 Programming book and
thought that this would allow me to limit the series to the penultimate row,
thus avoiding the "late binding" in case the array had the same effect as the
copy/paste method. He also has a link to your website in the appendix so I
checked that out, and some of the others that you link to as well.
I copied a number of the offset variations (and a couple of my own
creations) into my charts but they all fell over for one reason or another. I
dont recall the error numbers off the top of my head, I'm afraid. The errors
only happen when the update sub is running and capturing data in real time,
it's fine if I use the same code on "static" data and update the series by
manually inputting it.
The chart needs to plot a time series on the X axis in seconds. On the Y
axis, I need the volume of money traded in the last second, and also 2 moving
averages of N seconds, or more if possible for different time frames (N1, N2,
N3 etc). One for the volume of money available at the current buy price and
one for the volume of money available at the current sell price. On a
secondary Y axis I need to show the current last traded price and one or more
moving averages for that price. The time series is in Col A, the last traded
price in Col K, the volume of money traded in the last second is in Col W and
the moving averages are calculated by the chart but the underlying data is
Col X for the sell volume available and Col Y for the buy volume available.
In the appendix of his book, John described you as having an, "uncanny
ability to solve practically any chart-related problem." As a VBA newbie, I
would really appreciate your opinion on XL's capability. Is it possible to
create a chart as per the above and update every second with VBA? If so, how
do I go about it?
I look forward to hearing from you.
Kind regards
GG