MidArrowheadStyle?

W

William Alexander

I am trying to write a program to explain vectors
Mathematics students. I would really like to use the
AddLine Method in VB and put an arrowhead in the middle of
the line. Excel has EndArrowheadStyle but does anyone
know of MidArrowheadStyle.

Thanks

William
 
B

Bernie Deitrick

William,

No, Excel doesn't have a mid arrow head. But you can fudge it easily enough:

Start1 = 0
Start2 = 100
end1 = 200
end2 = 300
ActiveSheet.Shapes.AddLine(Start1, Start2, Start1 + (end1 - Start1) / 2, Start2 + (end2 - Start2) / 2).Select
Selection.ShapeRange.Line.EndArrowheadStyle = msoArrowheadTriangle
Selection.ShapeRange.Line.EndArrowheadLength = msoArrowheadLengthMedium
Selection.ShapeRange.Line.EndArrowheadWidth = msoArrowheadWidthMedium
ActiveSheet.Shapes.AddLine Start1 + (end1 - Start1) / 2, Start2 + (end2 - Start2) / 2, end1, end2

HTH,
Bernie
Excel MVP
 

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

Top