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

查看:2833
本文介绍了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 represents. 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 represents?

推荐答案

还可以仅提供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

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

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

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

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