![]() |
Add Series to a chart failure and Disappearing Series
I have an Excel 2000 macro that puts several series of XY data on a
scatter chart, and it then computes XY data too add a final series to the chart. I originally tried to use the Add method of the SeriesCollection object to add the final series. Since the number of points in the final series is computed and is not known prior to run time, I counted the rows and used: Set rng = Sheets("New Data"). _ Range ("A1").Resize(norws,2) rng.Name = "NewSer" to name the range. I then used the named range in the Source parameter of the Add method. Instead of using the X data from the named range, the point numbers were used. The Y values were correct. For example, if there were 8 points in the new series with XValues ranging from 2.1 to 67.5, the XValues used by Excel were the integers 1 to 8. I am guessing that Excel decided the new series was a Line format instead of XY format. When I repeated code that the chart was XYScatterLine, I got the Error Message "Parameter Not Found" for the named range, "NewSer". I decided to try the NewSeries method and assign the Values and XValues as named ranges. This method works fine except that the last series of the original data occasionally disappears when the new (final) series is added. If I step through the code, the code always works as intended. Can anyone explain this behavior for both the Add method and the New Series method and suggest solutions? |
All times are GMT +1. The time now is 05:05 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com