Updating the Chart range in a loop
I wrote code to create an embedded chart in EXCEL 2003 using the example given in page 181 of EXCEL 2002 VBA . I changed the way the source data is given to be given using a range name:
.SetSourceData Source:=Sheets("Sheet1").Range("DataTT"), PlotBy _
:=xlColumns
First, I initialize the graph. Later I have I loop where I get in every itration new data that are added to the range name:
With Range("DataTT")
.Resize(.Rows.Count + 1).Name = "DataTT"
End With
With Cht
.SetSourceData Source:=Sheets("Sheet1").Range("DataTT"), PlotBy _
:=xlColumns
End With
I expect that the chart is actualized automatically in each iteration of the loop, but it does not happen in that way. The chart is actualized until the end of the loop where all the data points are added togeter. I nees a chart that shows in real time how each new datum is added.
May anybody tell me what I am missing?
Regards,
Elim
|