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

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".

Forum statistics

Threads
1,144,736
Messages
5,725,994
Members
422,652
Latest member
Elnene1

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
Top