Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Draw arrow from one cell edge to another cell edge

Tags:

excel

In Excel, I want to draw an arrow from cell B2, right side, to cell C10, left side. This arrow should be coupled to the cells, so if I resize the cells, or cut-paste them to a new place, the arrow should move as well. Is there any way to accomplish this?

p.s. I would settle for a line instead of an arrow if this is easier.

like image 704
physicalattraction Avatar asked Nov 23 '22 23:11

physicalattraction


1 Answers

To add manually (in Excel):

  • Older Excel versions: Go to the Insert menu -> Shapes -> Arrow
  • Excel 2016+: Go to the Insert menu -> Illustrations -> Shapes -> select an arrow type.

Position the arrow on the sheet and use the grips to adjust the position.


or with VBA:

ActiveSheet.Shapes.AddConnector( msoConnectorStraight, _
    Range("B2").Left, Range("B2").Top, Range("C10").Left, Range("C10").Top ).Select
Selection.ShapeRange.Line.EndArrowheadStyle = msoArrowheadOpen

Adjust to the cells you want...

  • Documentation from Microsoft: Shapes.AddConnector method (Excel)
like image 115
user3514930 Avatar answered Jun 22 '23 19:06

user3514930