Excel Charts. How to set title and labels [message #550882] |
Fri, 13 April 2012 04:07 |
|
calacausi
Messages: 23 Registered: March 2012
|
Junior Member |
|
|
hi,
im still trying to create workcharts into an Excel sheet (see thread "How to create pie chart in Excel sheet"). I could not be able to create pie chart, but I got to create a histogram chart. Now, I wish to customize labels and legend.
The issue is that the data range is made by non-contigouous cells, and some of them are merged. So, I tried to create by hand a pie chart, and this is the code behind:
Sub Macro1()
'
' Macro1 Macro
'
'
Sheets("SUMMARY COSTS 2011-2012-2026").Select
Range("D11,F11").Select
Range("F11").Activate
ActiveSheet.Shapes.AddChart.Select
ActiveChart.ChartType = xl3DPieExploded
ActiveChart.SetSourceData Source:=Range( _
"'SUMMARY COSTS 2011-2012-2026'!$D$11;'SUMMARY COSTS 2011-2012-2026'!$F$11")
ActiveChart.SeriesCollection(1).Name = "=""SUMMARY"""
ActiveChart.SeriesCollection(1).XValues = _
"='SUMMARY COSTS 2011-2012-2026'!$C$4;'SUMMARY COSTS 2011-2012-2026'!$E$4"
Application.Goto Reference:="Macro1"
End Sub
how can I implement this code in Forms 10g using OLE2? In details, how does SeriesCollection work? Thanks for your help
-
Attachment: step2.jpg
(Size: 213.95KB, Downloaded 774 times)
|
|
|
|
|
|