I know this has been done before but just to keep my mind active in retirement I have decided to program excel to calculate the properties of a triangle given three sides or two sides and an angle etc. etc.
I now want to draw that triangle on the worksheet - I want it to be the correct shape. It is easy to calculate the co-ordinates of the three corners in terms of X and Y as you would plot on graph paper.
What I am looking for is how to translate that into vba code. Code like this
With myDocument.Shapes.AddLine(10, 10, 250, 250).Line
would appear to be one way of doing it but how would I convert the co-ordinates of the triangle into "points" that the above command requires. It is possible to define the origin that the "points" use or is it always in the top left corner of the work sheet.
AQ
Bookmarks