Syntax to trend an array of values?

SteveInAlabama

Board Regular
Joined
Aug 22, 2002
Messages
94
In one module, I declare an array using:
Global ADWgtXBar as variant.
Then I fill the array. OK, everything is fine. I can see values in my array.

In a different module, with no parameters passed, I can still see individula elements of this array. Then I do the following:

Set oCht = Worksheets("Entry Form").ChartObjects("Chart 2").Chart
With oCht
'.SeriesCollection(1).Values = ADWgtXBar 'this will NOT work - error says Unable to set the Values Prop of the Series Class.
.SeriesCollection(1).Values = Array(ADWgtXBar(1), ADWgtXBar(2)) 'This works fine
End With

I want the whole array in the series (up to 70 points) so the second line is impractical. Why won't the array pass as an array, and what syntax would work?

Thanks in advance.

Steve
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)

Forum statistics

Threads
1,214,649
Messages
6,120,731
Members
448,987
Latest member
marion_davis

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top