This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.
ActiveSheet.Shapes.Range(Array("My Triangle")).Adjustments.Item(1) = [O2]
But I would like some code that keeps the apex at zero and sets the apex angle to 60 degrees.Sub HypAndAngle()
ActiveSheet.Shapes(Application.Caller).Select
Dim x, y, hyp, angle As Double
Const Pi = 3.1415926 'defines constant for pi
x = Selection.ShapeRange.Height
y = Selection.ShapeRange.Width
hyp = Round(Sqr(x ^ 2 + y ^ 2), 2) 'calculate hypotenuse
angle = Round(Atn(y / x) * 180 / Pi, 2) 'round angle to 2 decimals
[A5] = x
[B5] = y
[B6].Value = hyp
[B7].Value = angle
[B8] = 90 - angle
[A2].Select
End Sub
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.