VBA:从 sheets1 代码打印 sheets2 中的形状 - 选择
VBA: Print shapes in sheets2 from sheets1 code - Selection
基于在编写代码的工作表 1 中单击按钮,我想在工作表 2 上添加一个形状并使用 Select 更改一些形状属性,如下面的代码所示。
With Sheets(2).Shapes.AddShape(msoShapeOval, 800, 700, 60, 60).Select
Selection.Text = "Shape"
Selection.Font.Size = 26
End With
难道不应该 select 纸张 2 并打印形状并更改其属性吗?或者当我执行 Selection 时,它是否试图从工作表 1 中找到值?
你可以试试这个
Sheets(2).Shapes.AddShape(msoShapeOval, 800, 700, 60, 60).Select
Selection.ShapeRange(1).TextFrame2.TextRange.Characters.Text = "Shape"
Selection.ShapeRange(1).TextFrame2.TextRange.Characters.Font.Size = 26
基于在编写代码的工作表 1 中单击按钮,我想在工作表 2 上添加一个形状并使用 Select 更改一些形状属性,如下面的代码所示。
With Sheets(2).Shapes.AddShape(msoShapeOval, 800, 700, 60, 60).Select
Selection.Text = "Shape"
Selection.Font.Size = 26
End With
难道不应该 select 纸张 2 并打印形状并更改其属性吗?或者当我执行 Selection 时,它是否试图从工作表 1 中找到值?
你可以试试这个
Sheets(2).Shapes.AddShape(msoShapeOval, 800, 700, 60, 60).Select
Selection.ShapeRange(1).TextFrame2.TextRange.Characters.Text = "Shape"
Selection.ShapeRange(1).TextFrame2.TextRange.Characters.Font.Size = 26