问题
This code works fine, but i have my sheet BLOCKED for selections.
Sheets("sheet1").Shapes("test_" & i).Select
Selection.Formula = ""
...and i want to to this:
Sheets("sheet1").Shapes("test_" & i).Formula = ""
But i got the object error to not accept this prop or method.
What am i missing?
回答1:
Formula
is a property of the DrawingObject
property:
Sheets("sheet1").Shapes("test_" & i).DrawingObject.Formula = ""
For an activeX textbox (assuming you want to change the LinkedCell
property):
Dim tb
Set tb = ActiveSheet.Shapes("test_" & i)
tb.OLEFormat.Object.LinkedCell = ""
来源:https://stackoverflow.com/questions/58382527/how-to-break-this-shape-reference-code-in-2-lines