Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
ActiveX Chart
I am trying to create a chart in a userform that has the following ranges as
X and Y values: lastcol = Worksheets("A").Cells(1, 2).End(xlToRight).Column XValues = Range(Cells(1, 2), Cells(1, lastcol)) YValues = Range(Cells(2, 2), Cells(2, lastcol)) However, I can't figure out how to set up the array for the chart. I have the following code in my userform. Any help would be greatly appreciated. Thanks! Sub Chart_1() Dim Chart1 As ChChart Dim Series1 As ChSeries Dim XValues As Variant Dim YValues As Variant ChartSpace1.Clear Set Chart1 = ChartSpace1.Charts.Add lastcol = Worksheets("Values").Cells(2, 1).End(xlToRight).Column XValues = Array(Range(Cells(1, 2), Cells(1, lastcol))) YValues = Array(Range(Cells(2, 2), Cells(2, lastcol))) Set Series1 = Chart1.SeriesCollection.Add With Series1 .Type = chChartTypeLine .SetData chDimCategories, chDataLiteral, XValues .SetData chDimValues, chDataLiteral, YValues End With End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
ActiveX control with chart | Charts and Charting in Excel | |||
both a chart and a gauge (an activeX) | Charts and Charting in Excel | |||
activeX interfere with chart | Excel Programming | |||
ActiveX control for chart | Excel Programming | |||
ActiveX Chart Properties in Excel 2000 | Excel Programming |