AddChart2 VBA宏中的数字代表什么? [英] What does the number in the AddChart2 VBA macro represent?

查看:133
本文介绍了AddChart2 VBA宏中的数字代表什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已使用Excel 2013在插入图表(在我的情况下为列群集的图表)中记录宏。在查看代码选项中,它向我显示了以下代码行:

I've use my Excel 2013 to record a macro in inserting a chart, a column-clustered chart in my case. In the view code option, it shows me a line of code as below:

ActiveSheet.Shapes.Addchart2(286,xl3DColumnClustered).Select

请帮助我,因为我不明白286代表什么。我知道Addchart2的语法是:

Please help me as I cannot understand what does the number 286 represent. I know the syntax of Addchart2 is:

expression.AddChart2(Style,XlChartType,Left,Top,Width,Height,NewLayout)

如果将 286更改为 285,则图表显示为蓝色背景。如果数字是100,则会出现错误。

If I change the "286" to "285", the chart appears with a blue background. An error comes out if the number is 100.

有人可以告诉我数字代表什么吗?

Can anyone kindly tell me what does the number represent?

推荐答案

一个人也只能提供ChartType,应用程序将使用默认样式。

One can also provide only the ChartType and the application will use the default style.

Set oShp = ActiveSheet.Shapes.AddChart2(XlChartType:=xl3DColumnClustered)
oShp.Chart.SetSourceData Source:=RngDta

此图显示了所有ChartType(不包括StockHLC和StockVOHLC)的默认ChartStyle。

This picture shows the default ChartStyle for all ChartTypes (excluding StockHLC and StockVOHLC)

这篇关于AddChart2 VBA宏中的数字代表什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆