unable to set the values property of the series class

B

BHatMJ

I get this error message "unable to set the Values property of the Series
class" when trying to re-set a chart series to another range. Can anyone
help?

CODE:

Worksheets("analyze").ChartObjects("resChart").Activate
ActiveChart.ChartArea.Select
ActiveChart.SeriesCollection(1).Values = "=results!R4C4:R4C63"
 
B

BHatMJ

Thank you for your help but .Formula did not work. The following code seems
to work but will sporadically lock up and then cause the error:

Worksheets(1).ChartObjects(1).Chart.SeriesCollection(3).Values = _
Worksheets(2).Range("D3:BK3")

It seems as if all of these should work and I cannot understand why a series
seems to "lock up" after several runs of the program. Once "locked", it
always creates the error. If I delete the chart and re-create a new one, the
code works again.

Can anyone explain or help?
 
E

Ethoros

This code should help you. it finds and replaces text in in series.

<code>
Sub Chart_Series_Replacer()


If ActiveSheet.chartobjects.Count > 0 Then
S_Str = InputBox("Please input string you wish to find", "Search Text")
R_Str = InputBox("Please input string you wish to Replace With",
"Replace Text")
For i = 1 To ActiveSheet.chartobjects.Count
With ActiveSheet.chartobjects(i).Chart
For intSeries = 1 To .SeriesCollection.Count
strData = .SeriesCollection(intSeries).Formula
strData = Replace(UCase(strData), UCase(S_Str), UCase(R_Str))
.SeriesCollection(intSeries).Formula = strData
Next
End With
Next i
End If
End Sub
</code>
 
B

BHatMJ

Thank you Ethoros but, inexplicably, it still does not work. When I set
..Formula = "=d4:bk4", it places a text box with the formula string on the
chart.
 

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