如何将此形状参考代码分成两行?
How to break this shape reference code in 2 lines?
此代码工作正常,但我的 sheet 被阻止选择。
Sheets("sheet1").Shapes("test_" & i).Select
Selection.Formula = ""
...我想这样做:
Sheets("sheet1").Shapes("test_" & i).Formula = ""
但是我收到对象错误,无法接受此道具或方法。
我错过了什么?
Formula
是 DrawingObject
的 属性 属性:
Sheets("sheet1").Shapes("test_" & i).DrawingObject.Formula = ""
对于 activeX 文本框(假设您要更改 LinkedCell
属性):
Dim tb
Set tb = ActiveSheet.Shapes("test_" & i)
tb.OLEFormat.Object.LinkedCell = ""
此代码工作正常,但我的 sheet 被阻止选择。
Sheets("sheet1").Shapes("test_" & i).Select
Selection.Formula = ""
...我想这样做:
Sheets("sheet1").Shapes("test_" & i).Formula = ""
但是我收到对象错误,无法接受此道具或方法。
我错过了什么?
Formula
是 DrawingObject
的 属性 属性:
Sheets("sheet1").Shapes("test_" & i).DrawingObject.Formula = ""
对于 activeX 文本框(假设您要更改 LinkedCell
属性):
Dim tb
Set tb = ActiveSheet.Shapes("test_" & i)
tb.OLEFormat.Object.LinkedCell = ""