Can not set Y Values in XY chart

L

L Mehl

Hello --

I use the following code to set X and Y values:

g_strRangeSeries = "A2:A82" (calculated in prior code)
strDataXValues = Chr(34) & "=Data!" & g_strRangeSeries & Chr(34)
ActiveChart.SeriesCollection(1).XValues = strDataXValues

This correctly places
={"=Data!A2:A82"}
in
Source Data | Series | X Values:

The problem is with setting Y Values.

g_strRangeYVal = "B2:B82" (calculated in prior code)
strDataValues = Chr(34) & "=Data!" & g_strRangeYVal & Chr(34)
ActiveChart.SeriesCollection(1).Values = strDataValues

This incorrectly places
={0}
in
Source Data | Series | Y Values:

Can someone tell me why my method works for X, but not Y?

Thanks in advance for any info.

Larry Mehl
 

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