简体   繁体   English

向图表(Excel VBA)添加控件(是否有ActiveX)

[英]adding a control (ActiveX or not) to a chart (Excel VBA)

I cannot find how to control a listbox I have added to a Excel Chart ie add/delete/select/unselect items and run macros accordingly. 我找不到如何控制已添加到Excel图表中的列表框的方法,即添加/删除/选择/取消选择项目并相应地运行宏。 I understand it is easier if the chart is embedded in a worksheet however I would very much like to do that on a separate sheet. 我知道将图表嵌入工作表中会更容易,但是我非常想在单独的工作表中进行操作。 Thanks. 谢谢。 Example: 例:

例

Even though the listbox is on the chart sheet, you should use some worksheet space somewhere for the list fill range and the linked cell. 即使列表框在图表工作表上,您也应该在列表填充范围和链接单元格的某处使用一些工作表空间。 It's much easier and more robust to access these ranges in VBA than to try to get them from the listbox. 在VBA中访问这些范围要比尝试从列表框中获取它们容易得多,也更可靠。

Speaking of reliability, the Form versions of all controls will be more reliable than their ActiveX analogues. 说到可靠性,所有控件的Form版本将比其ActiveX类似物更加可靠。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM