ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Resetting chart ranges (https://www.excelbanter.com/excel-programming/320624-resetting-chart-ranges.html)

Maury Markowitz

Resetting chart ranges
 
I have a sheet that imports one or more columns of data from out MSSQL
back-end. After some minor processing the results need to be graphed. However
the "height" of the column of data that represents the values is unknown
until after the data is returned.

What is the best way to deal with this? Currently I'm trying to use:

ActiveChart.SeriesCollection(1).Values =
"='Time comparison'!R13C2:R" & dates + 12 & "C2"

However this returns errors most of the time, saying:

Unable to set the Values property of the Series class. This error is
undocumented, but it appears to happen because the range in question is empty
(which, IMHO, should not be an error). I wrapped some tests around them to
see if there were at least some values, but now it's even failing on ones
that do have data.

Any ideas? Is there some easier way to make this work?

Maury


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com