This forum is for Independent Software Vendors (ISVs) to get help with architecting and developing applications. This is a VBA question and should be posted to the VBA forum, but since you allready tried that without luck I'll try to help.
To change the data for a chart, there's two options: a) Set the Values property of the SeriesCollection to a Range (i.e. ActiveChart.SeriesCollection(1).Values = ActiveSheet.Range("D1:D9"). In this sample I have two series; A1:A9 in SeriesCollection(1) and B1:B9 in SeriesCollection(2) and the code replaces the data in SeriesCollection(1) with the data from D1:D9. The chart updates immediately, no need to call any methods.
b) Set the Values property of the SeriesCollection to an array of values using the Array function such as ActiveChart.SeriesCollection(1).Values = Array(9, 8, 7, 6, 5, 4, 3, 2, 1) or by manually creating an array such as : Dim numbers(9) As Integer
For i = 1 To 9 numbers(i) = i Next
ActiveChart.SeriesCollection(1).Values = numbers
This posting is provided "AS IS" with no warranties, and confers no rights. MTC ISV Team [MSFT] |