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

查看:58
本文介绍了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天全站免登陆