![]() |
SourceData for graph
If I use the following code, the CatTitle, ChartYear, SrcRange are graphed as
series. I would like the CatTitle to be the title of the graph legend, the ChartYear to be the Xaxis and the ScrRange the series to graph. Can somebody help? thanks Dim TheChartObj As ChartObject Dim TheChart As Chart Dim ChartYear As Range Dim CatTitles As Range Dim SrcRange As Range Dim SourceData As Range Set TheChartObj = ActiveSheet.ChartObjects(10) Set TheChart = TheChartObj.Chart Set SrcRange = Range(ActiveCell.Offset(0, 2), ActiveCell.Offset(0, 24)) Set ChartYear = Range("f3:ab3") Set CatTitle = ActiveCell Set SourceData = Union(CatTitle, ChartYear, SrcRange) TheChart.SetSourceData _ Source:=SourceData, PlotBy:=xlRows TheChartObj.Visible = True -- caroline |
All times are GMT +1. The time now is 09:15 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com