MidArrowheadStyle?

  • Thread starter Thread starter William Alexander
  • Start date Start date
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
 
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
 
Back
Top