Jackyz
Jackyz

Reputation: 165

Draw ring-like shape in Excel

Is this shape drawable with .AddShape?
Which is his MsoAutoShapeType and how can I set the size of the internal circle?

enter image description here

Upvotes: 2

Views: 369

Answers (1)

Pᴇʜ
Pᴇʜ

Reputation: 57693

To adjust the internal circle you need to generate the donut first,

.AddShape(MsoAutoShapeType, Left, Top, Width, Height)

where Width and Height define the outer circle. And then adjust the inner circle of the shape with

.DrawingObject.ShapeRange.Adjustments.Item(1) = 0.45

So we have something like this

Dim myShape As Shape
Set myShape = Worksheets("MySheetName").Shapes.AddShape(msoShapeDonut, 10, 10, 50, 50)
myShape.DrawingObject.ShapeRange.Adjustments.Item(1) = 0.45

and it looks like that:

enter image description here


For references see:

Upvotes: 2

Related Questions