オートシェイプを記録して、forでまわしただけですが...
office 2003。
Sub Line()
' 円の中心
Dim centerX As Integer
centerX = 300
Dim centerY As Integer
centerY = 100
' 円の半径
Dim radius As Integer
radius = 100
Dim max As Integer
max = 200
For i = 0 To max Step 1
radian = 3.14 * 2 * i / max
x = Cos(radian) * radius + centerX
y = Sin(radian) * radius + centerY
' オートシェイプで線を引く。
ActiveSheet.Shapes.AddLine(x, y, centerX, centerY).Select
Selection.ShapeRange.Line.Weight = 0#
' 色をちょっとづつ変えてみる。
Dim calor As Integer
calor = 255 / max * i
Selection.ShapeRange.Line.ForeColor.RGB = RGB(calor, 255, 255)
Next i
End Sub

0 件のコメント:
コメントを投稿