ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Drawing Arcs (https://www.excelbanter.com/excel-programming/330006-drawing-arcs.html)

PraxisPete

Drawing Arcs
 
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.


mexage

Drawing Arcs
 
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.


"PraxisPete" wrote:

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.


PraxisPete

Drawing Arcs
 
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.


"Mexage" wrote:

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.


"PraxisPete" wrote:

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.


mexage

Drawing Arcs
 
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.

"PraxisPete" wrote:

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.


"Mexage" wrote:

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.


"PraxisPete" wrote:

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.



All times are GMT +1. The time now is 10:17 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com