Graph not plotting correctly if source not selected
Hi Jon
I've actaully look at your site. It look you set the chart source as
selection.
Here is my non-working code"
Set cht_src = Range(Range("A1").Offset(1, 2 * (c + 1) + 2),
Range("A1").Offset(Application.Count(Range("dist_x _axys")) + 1, 2 * (c
+ 1) + 2 + c))
Set Cht_level = Charts.Add
With Cht_level
.ChartType = xlLine
.SetSourceData Source:=cht_src
End With
here is my working code:
Set cht_src = Range(Range("A1").Offset(1, 2 * (c + 1) + 2),
Range("A1").Offset(Application.Count(Range("dist_x _axys")) + 1, 2 * (c
+ 1) + 2 + c))
cht_src.Select
Set Cht_level = Charts.Add
With Cht_level
.ChartType = xlLine
.SetSourceData Source:=cht_src
End With
The only difference is the cht_src.Select
I find it odd that you need to select the chart source in order to
graph it correctly.
|