Microsoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. Microsoft support professionals can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific needs.
If you have limited programming experience, you may want to contact a Microsoft Certified Partner or Microsoft Advisory Services. For more information, visit these Microsoft Web sites:
Microsoft Certified Partners -
https://partner.microsoft.com/global/30000104Microsoft Advisory Services -
http://support.microsoft.com/gp/advisoryserviceFor more information about the support options that are available and about how to contact Microsoft, visit the following Microsoft Web site:
http://support.microsoft.com/default.aspx?scid=fh;EN-US;CNTACTMSCreating the Sample Chart
Before you use the sample macro, create a chart to modify. To do this, follow these steps:
- Save and close all open workbooks, and then create a new workbook.
- In Sheet1 of the new workbook, type the following data:
A1: a B1: 1 C1: 3 D1: 2
A3: b B2: 4 C2: 2 D2: 1
A3: c B3: 5 C3: 1 D3: 3
- Select cell A1, and then click Chart on the Insert menu.
- In step 1 of the Chart Wizard, click Cone in the Chart type list.
- Under Chart sub-type, click the sample chart in the third row of types, and then click Finish.
An embedded 3-D Cone chart appears on Sheet1.
NOTE: The cones for each data point taper to a point.
Sample Macro for Changing Cone Shapes
- Start the Visual Basic Editor (press ALT+F11).
- On the Insert menu, click Module.
- Type the following code in the module:
Sub Change_Chart_Shapes()
Dim x As Chart
Dim y As Series
'x is the Chart object.
Set x = ActiveSheet.ChartObjects(1).Chart
'Loop through all the chart series.
For Each y In x.SeriesCollection
'Set the series chart subtype.
y.BarShape = xlConeToMax
Next
End Sub
- Run the Change_Chart_Shapes macro.
- Switch to Microsoft Excel (press ALT+F11).
Each of the cones (except one) in the chart no longer tapers to a point.
The only cone that tapers to a point is the cone that represents the value
in cell B3, which is the greatest value in all of the chart series.