Im case anybody else runs into this problem, I was able to find a solution. Not completely sure if it is the correct one, but definitely a solution. I first created the graph by hand and was able to manually manipulate the the XY and plot values. I then copied the formula the graph was using which appeared as such:
Quote:
|
='9A'!$C$1,'9A'!$E$1:$P$1,'9A"!$C$6:$C$7,'9A'!$E$6 :$P$7
|
From here I was able to break down the cell references to see how the graph was reading the formula. I then created variables for each of the 4 cell ranges in the formula. Using the UNION function, was able to combine the ranges into one statement. Code is below:
Quote:
ActiveSheet.Shapes.AddChart(xlColumnClustered, Left:=ActiveSheet.Range("j11").Left, Top:=ActiveSheet.Range("o11").Top, _
Width:=ActiveSheet.Range("j11:O24").Width, Height:=ActiveSheet.Range("j11:j24").Height).Selec t
Set Rng1 = ActiveSheet.Range("c1")
Set Rng2 = ActiveSheet.Range("e1:P1")
Set Rng3 = ActiveSheet.Range("c6:c7")
Set Rng4 = ActiveSheet.Range("e6:P7")
With ActiveChart
.SetSourceData Source:=Union(Rng1, Rng2, Rng3, Rng4)
.SetElement (msoElementChartTitleAboveChart)
.ChartTitle.Caption = "Cumulative STE Delivery"
.Legend.Position = xlBottom
.Legend.Left = 0.209
.Legend.Width = 325
.Legend.Height = 24
.SeriesCollection(1).ChartType = xlLineStacked
End With
|
That was enough to get the desired results I was looking for. Thanks to who all took the time to read this when I did not have a clue!