Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I can't seem to figure out how XL is using the following code. I am
trying to create a scatter plot of 2 series. Sometimes I get the 2 series as desired and sometimes I get 3 series. This 3rd series is empty (has been created, but the source data not set). I've checked the SeriesCollection.Count property at various places during the process. Before the first .SeriesCollection.NewSeries line the count is 0 and immediately after it is 1 (as it should be). So it seems to me that if the chart is created with 0 series and I want 2, then I must create them. How can I ever get 3 with this code??? Thanks, John ================================================== ========= Charts.Add ActiveChart.Location Whe=xlLocationAsNewSheet, Name:="Duration Plot" ActiveChart.ChartType = xlXYScatterLines With Charts("Duration Plot") .SeriesCollection.NewSeries .SeriesCollection(1).XValues = rngStartDates .SeriesCollection(1).Values = "=Dates!R1C3:R52C3" .SeriesCollection(1).Border.Weight = xlThin .SeriesCollection(1).Border.ColorIndex = 11 .SeriesCollection(1).Name = "Req'd Calendar Days" .SeriesCollection.NewSeries .SeriesCollection(2).XValues = "=Dates!R1C1:R52C1" .SeriesCollection(2).Values = "=Dates!R1C2:R52C2" .SeriesCollection(2).Border.Weight = xlThick .SeriesCollection(2).Border.ColorIndex = 7 .SeriesCollection(2).AxisGroup = 2 .SeriesCollection(2).MarkerStyle = xlNone .SeriesCollection(2).Name = "Completion Date" ================================================== ========= There is a good bit more code, but it is just formatting things. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How create a formula series with series inside | Excel Worksheet Functions | |||
how to create a series of numbers | Excel Discussion (Misc queries) | |||
Need to create a series of dates across a row | Excel Discussion (Misc queries) | |||
How to Create a Date Series across a row? | Excel Discussion (Misc queries) | |||
How to create a form to insert a hyerlink.VBA code to create a for | Excel Discussion (Misc queries) |