excelperfect
标签:VBA
这是在www.wimgielis.com中看到的一段代码,可以在工作表中自动添加一个矩形,用户可以指定矩形的大小和填充的颜色,以及指定相关联的宏。...String
On Error Resume Next
Set ws = ActiveSheet
sDimensions = Trim(Application.InputBox("请输入形状的大小...(行 x 列)", "形状大小", "3x3", , , , , 2))
iColor = Trim(Application.InputBox("请输入形状的颜色: 1 =蓝色, 2 =绿色, 3...(1)
If Len(s) = 0 Then s = .OnAction
sText = Trim(Application.InputBox("请输入形状中的文本", "形状文本", s..., , , , , 2))
If sText = "False" Or Len(sText) = 0 Then sText = "添加标题"
With .TextFrame.Characters