Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.charting
|
|||
|
|||
![]()
I'm trying to write a macro that will fill a data series based on a
single value in a spreadsheet. In this example, Series 1 is the actual observation data. Series 2 would be the average for all points in Series 1. My code works fine as long as the series average is rounded to zero decimal places. If not, I receive the error "Subscript out of Range". I've tried declaring "i" as various data types to no avail. Help would be appreciated. Sub AddAverageLine() 'Populate GrandMean values Dim ar As Variant ReDim ar(1 To p) p = ActiveChart.SeriesCollection(1).Points.Count i = Round(Range("GrandMean"), 0) 'WANT THIS TO 2 DECIMALS NOTE 0 For x = 1 To UBound(ar) ar(x) = i Next x ActiveChart.SeriesCollection(2).Values = ar End Sub - John |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Create Array for Data Source | Charts and Charting in Excel | |||
Updating charts when data source is in a different file | Charts and Charting in Excel | |||
ranking query | Excel Discussion (Misc queries) | |||
Charts not recognizing source data if original linked data is changed. | Charts and Charting in Excel | |||
Extending a Chart Data Series from an Array - Can it be done? | Charts and Charting in Excel |