作成者カテゴリ返答の対象
公開
顔爺
05/06/2003 11:13 AM
文書リンクアイコン Excelのテキストボックス
昔作ったスクリプトですが参考になれば

Public Sub AddTextBox2Excel(sheet,objName As String,caption As String,l As Single,t As Single,w As Single,h As Single,fontSize As Single,fontName As String)
' テキストボックス(非VB TextBox) をシートに追加する
Dim obj
Set obj = sheet.shapes.AddTextBox(1,l,t,w,h)
obj.Name = objName
With sheet.shapes(objName)
.Fill.Visible = 0
.Line.Visible = 0
.TextFrame.Characters(1).Font.Size = fontSize
.TextFrame.Characters(1).Font.Name = fontName
.TextFrame.Characters(1).Text = caption
End With
End Sub

sheet -> Worksheet
objName -> 新規作成したテキストボックスにつける名前
caption -> テキストボックス内に入れるテキスト
l,t,w,h -> テキストボックスの座標
fontName,fontSize -> フォント設定


[Previous Main Document]
Excelのテキストボックス (べっちー)
. . Re: Excelのテキストボックス (1122)
. . . . Re: Excelのテキストボックス (べっちー)
. . . . . . Re: Excelのテキストボックス (1122)
. . . . . . . . Re: Excelのテキストボックス (べっちー)
. . . . . . . . . . 昔作ったスクリプトですが参考になれば (顔爺) * 現在地 *
. . . . . . . . . . . . Re: 昔作ったスクリプトですが参考になれば(お礼) (べっちー)
[Next Main Document]