Excel vba更改形状公式而不选择形状 [英] Excel vba Change shape formula without selecting shape

查看:131
本文介绍了Excel vba更改形状公式而不选择形状的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



下面是我的一些代码,我正在尝试更改一个形状中的公式,而不选择它,但是不断得到运行时错误。尝试到目前为止:

  Sheets(Quote)。Shapes.Range(Array(Rectangle 87)) = CommAnnualOutput
Sheets(Quote)。形状(Rectangle 87)。Formula == CommAnnualOutput
表格(Quote)。形状(Rectangle 87)。DrawingObjects。 Formula == CommAnnualOutput

这些似乎都不行。有没有办法改变公式,而不先选择形状?

解决方案

请在这里找到你的问题的答案: p>

使用Excel形状链接单元格



祝你好运


I'm trying to change the formula within a shape without selecting it but keep getting a run-time error.

Below are some of the code I've tried so far:

    Sheets("Quote").Shapes.Range(Array("Rectangle 87")).Formula = " =CommAnnualOutput"
    Sheets("Quote").Shapes("Rectangle 87").Formula = " =CommAnnualOutput"
    Sheets("Quote").Shapes("Rectangle 87").DrawingObjects.Formula = " =CommAnnualOutput"

None of these seem to work. Is there a way to change the formula without selecting the shape first?

解决方案

Please find the answer to your question here:

Link cell with Excel Shape

Good luck

这篇关于Excel vba更改形状公式而不选择形状的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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