|
Sub test()
n = InputBox("请输入蓝色球的个数!", "输入个数")
ActiveSheet.Shapes.AddShape(msoShapeOval, 300, 200, 50, 50).Select
With Selection.ShapeRange.Fill
.ForeColor.RGB = RGB(255, 0, 0)
End With
Selection.ShapeRange.Line.Visible = msoFalse
For i = 1 To n
x = 300 + Sin((i / n) * 360 * 3.142 / 180) * 100
y = 200 - Cos((i / n) * 360 * 3.142 / 180) * 100
ActiveSheet.Shapes.AddShape(msoShapeOval, x, y, 50, 50).Select
Selection.ShapeRange.Line.Visible = msoFalse
x2 = 325 + Sin((i / n) * 360 * 3.142 / 180) * 45
y2 = 225 - Cos((i / n) * 360 * 3.142 / 180) * 45
x1 = 325 + Sin((i / n) * 360 * 3.142 / 180) * 75
y1 = 225 - Cos((i / n) * 360 * 3.142 / 180) * 75
ActiveSheet.Shapes.AddConnector(msoConnectorStraight, x1, y1, x2, y2).Select
Selection.ShapeRange.Line.EndArrowheadStyle = msoArrowheadTriangle
With Selection.ShapeRange.Line
.Visible = msoTrue
.DashStyle = msoLineSysDot
End With
Next i
End Sub
|
评分
-
1
查看全部评分
-
|