excel画半圆(上半圆)。求VBA编程代码。已知圆心坐标,半径。最好坐标轴也画出来。

圆心坐标X,Y,半径R,分别在textbox1 textbox2 textbox3中输入。
2024-11-27 13:25:26
推荐回答(2个)
回答1:

Sub txy()
Set myShe = Application.ActiveSheet '设置对象游租变量
'Set myJh = New Collection '设置新集合变量
myleft = Application.ActiveCell.Left + 10 '获得激活单元格的神笑兆左边距
mytop = Application.ActiveCell.Top + 10 '获升野得激活单元格的上边距
With myShe.Shapes.AddShape(msoShapeOval, myleft, mytop, 200, 200) '添加园 msoShapeOval椭圆形
.Fill.Transparency = 1 '设置形状为透明
.Line.Weight = myXt + 0.75 '设置线条宽度
.Line.ForeColor.RGB = myRGB '设置前景色
End With
End Sub
==========================
学习中,呵呵。

回答2:

Sub Draw_Curve()
ActiveSheet.Shapes.AddShape(msoShapeArc, textbox1.value, textbox2.value - textbox3.value, textbox3.value, textbox3.value).Select

Selection.ShapeRange.Adjustments.Item(1) = 180#
End Sub