是否有可能通过宏添加文本框?所以我单击链接,它添加了一个文本框...我之前做的是设置文本框的默认外观。因此,当我添加它时,它总是看起来我想要的。
答案 0 :(得分:0)
我为此录制了一个宏...它可能不是最好的解决方案,但它完成了你要求的任务。
Sub AddTextbox()
'
' Macro1 Macro
'
'
ActiveSheet.Shapes.AddTextbox(msoTextOrientationHorizontal, 361.5, 59.25, 420, _
90.75).Select
Selection.ShapeRange(1).TextFrame2.TextRange.Characters.Text = _
"Here you have your textbox"
Selection.ShapeRange(1).TextFrame2.TextRange.Characters(1, 26).ParagraphFormat. _
FirstLineIndent = 0
With Selection.ShapeRange(1).TextFrame2.TextRange.Characters(1, 26).Font
.NameComplexScript = "+mn-cs"
.NameFarEast = "+mn-ea"
.Fill.Visible = msoTrue
.Fill.ForeColor.ObjectThemeColor = msoThemeColorDark1
.Fill.ForeColor.TintAndShade = 0
.Fill.ForeColor.Brightness = 0
.Fill.Transparency = 0
.Fill.Solid
.Size = 11
.Name = "+mn-lt"
End With
End Sub
答案 1 :(得分:0)
我设法创建了一个工作按钮......我使用了这段代码:
Private Sub CommandButton1_Click()
ActiveSheet.Shapes.AddTextbox(msoTextOrientationVertical, 361.5, 59.25, 420, _
90.75).Select
Selection.ShapeRange(1).TextFrame2.TextRange.Characters.Text = _
"Here you have your textbox"
Selection.ShapeRange(1).TextFrame2.TextRange.Characters(1, 26).ParagraphFormat. _
FirstLineIndent = 0
End Sub