Drawing Arcs

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi Everybody, I am running Excel 2002 and using VB to draw shapes on my
worksheet, but I need to draw arcs by providing the start and finish points
and the radius. Is there a way to do this in Excel, or does anyone know of
an Add-in that could achieve this?

Many thanks in advance.
 
Dear Praxis Pete:

I recorded a macro in Excel 2003 and I got the following:

ActiveSheet.Shapes.AddShape(msoShapeArc, 258#, 68.25, 114#, 89.25).Select
Selection.ShapeRange.Adjustments.Item(2) = 144.7255

The first line draws the arc in coordinate (258,62.25), width 114, height
89.25
And then modifies the ending angle to 144.7255

Try recording a macro (use the drawing toolbar to draw the arc in autoshapes)

Hope this helps, if it does, please rate this post.
G.Morales.
 
Dear G.Morales

I tried recording a macro and found that i could change the start and end
points, and scale the arc but I cannot see how to specify the radius.

Thanks for replying.
 
You can't specify the radius directly, but you can use the width and height.

You could make a sub such as:

sub DrawArc(single x, single y, single r, single start, single finish)

ActiveSheet.Shapes.AddShape(msoShapeArc, x, y, r, r).Select
Selection.ShapeRange.Adjustments.Item(1) = start
Selection.ShapeRange.Adjustments.Item(2) = finish

end sub


Hope that helps; if it does, please rate this post.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top