我有一个(x,y)坐标,它将在散点图中绘制。我需要在绘制的点周围绘制一个半径为R的圆。
谢谢和问候, Prabhu.C
答案 0 :(得分:0)
一个'裸骨'的例子可能会让你开始。您需要使用缩放,单位和定位等来满足您的背景。
这将绘制一个没有填充和红色圆周的圆圈,带有注释掉的线条以给它一个实心填充(更改。对于msoTrue可见。)
Sub drawCircle()
Dim ws As Worksheet
Dim cLeft As Long, cTop As Long
Dim cX As Long, cY As Long, cDia As Long
Dim c1 As Shape
Set ws = Sheets("Sheet1")
cX = Range("A2")
cY = Range("B2")
cDia = Range("C2").Value * 2
cLeft = cX - (cDia / 2)
cTop = cY - (cDia / 2)
With ws
Set c1 = .Shapes.AddShape(msoShapeOval, cLeft, cTop, cDia, cDia)
With c1
.Fill.Visible = msoFalse
.Line.Weight = 2
.Line.ForeColor.RGB = RGB(255, 0, 0)
'.Fill.ForeColor.RGB = RGB(255, 0, 0) 'eg Red fill
End With
End With
End Sub