On Fri, 14 Nov 2008 03:33:35 GMT, "Stratocaster" <stotz1@verizon.net>
wrote:
Quote:
|
>Thanks for your input Alfie.
|
You're welcome :)
Quote:
>However, this also forces Excel to graph all empty columns and the result is
>ugly. So then, how could I perform this graphing loop so that future
>updates would be recognized by these graphs?
|
There are 2 things you need to do, firstly work out what range you
need, then assign that into a data series.
To work out how far a row of data extends you can use a loop to scan
for empty cells, although this will depend upon how your data is laid
out. For instance;
Dim cnt As Long
cnt = 0
Do While Range("A1").Offset(1, cnt) <""
cnt = cnt + 1
Loop
....will step through the second row looking for an empty cell, cnt
will then hold the (R1C1 format) column offset of the first empty
cell.
ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.ChartArea.Select
ActiveChart.SeriesCollection.NewSeries.Values = "=R2C1:R2C" & cnt
....will then add that series to the chart (you may get anomalous
results if that series is already included in the chart).
These are rather rough and ready solutions though, it's been a while
since I had to use Excel in any real capacity, and may not fit your
data series, but might give you another angle to approach it from.
--
Alfie [UK]
<http://www.delphia.co.uk/>
Some people drink from the fountain of knowledge...I think you barely gargled.