2011-02-28 308 views
2

我想弄清楚如何使用VBA在Excel中更改圆角矩形形状的圆度。Excel/VBA:在VBA/Excel中更改圆角矩形的圆度

我从创建圆角矩形开始,但此时我不确定接下来要做什么。

Set roundedRec = ws.Shapes.AddShape(msoShapeRoundedRectangle, 10, 10, 200, 40) 

我GOOGLE了vba shapes roundness roundedexcel vba rounded rectangle corner radius和其他类似的短语,但没有发现任何东西非常有启发性或有帮助。我开始认为我不能通过视觉基础来改变这个属性,尽管我可以通过Excel的GUI来完成。

回答

0

我一派msoShapeRoundedRectangle radius,并且第一link有一个例子:

With oSh 
    oSh.AutoShapeType = msoShapeRoundedRectangle 
    .Adjustments(1) = sngRounding 
End With 
0

形状对象具有其具有方法

.OneColorGradient(风格,变体,度)

一个Fill属性

.TwoColorGradient(Style,Variant)

检查使用

Set shp = ActiveSheet.Shapes("Rounded Rectangle 1") 
shp.Adjustments(1) = shp.Adjustments(1) * 2 

shp.Fill.ForeColor.RGB = RGB(0, 0, 128) 

shp.Fill.OneColorGradient msoGradientHorizontal, 1, 1 
+0

OP编辑该部分的问题出来... – mellamokb 2011-02-28 19:19:55