...

MS Excel VBA

Excel is not only a wonderful tool for data entry and data analysis but likewise great at making charts, flow charts, simple diagrams, etc.

It’s quite simple in Excel to insert a line then customize and position it. You’ll be surprised how multiple options you get when you need to draw a line in Excel.

You can easily draw a line to connect two boxes (to show the flow) or add a line in an Excel chart to highlight specific data points or trends.

How to Insert a Line in MS Excel (Using Illustration)

To insert a line in the Sheets in Excel, you need to use the Shapes option. It inserts a line as a shape object that you can carry and place anywhere in the worksheet.

You can also easily customize it by changing the size, thickness, color, adding effects such as shadow, etc.

Below are the steps to insert a line shape in MS Excel

  1. Open the Excel workbook and activate the worksheet in which you want to draw/insert the line
  2. Click the Insert tab

Click the Insert tab

  1. Click on Illustrations
Click on Illustration icon
  1. Click on the Shapes icon
Click on Shapes option
  1. Choose from any of the existing 1 2 Line options
  2. Go to the worksheet, click the left key on your mouse/trackpad and pull the cursor to insert a line of that length

Line inserted in the worksheet

The above steps would instantly insert the line you selected in step 5.

These are the 12 line options that you have available in Excel:

  1. Straight Line
  2. Line Arrow (with an arrow at one end of the line)
  3. Line Arrow Double (arrow at both ends)
  4. Connector: Elbow (use this to connect boxes, this is not a straight line)
  5. Connector: Elbow arrow (arrow at one end)
  6. Connector: Elbow double-arrow (arrow at both ends)
  7. Connector: Curved
  8. Connector: Curved Arrow
  9. Connector: Curved Double-Arrow
  10. Curve
  11. Freeform: Shape
  12. Freeform: Scribble

Adding Multiple Lines in One Go

When you use the above steps, you can only insert any line shapes once. If you need to insert it again (say you want to insert 3 lines), you will have to repeat the process twice.

Instead, you can lock the drawing mode to keep inserting the lines in one go.

Below are the steps to lock the line drawing mode:

  1. Open the Excel workbook and activate the worksheet in which you want to draw/insert the line
  2. Click the Insert tab
  3. Click on Illustrations
  4. Click on the Shapes icon
  5. Right-click on any of the line shapes that you want lock (i.e., the one that you want to insert multiple times)
  6. Click on Lock Drawing Mode
Select Lock drawing mode option
  1. Click anywhere in the worksheet

When you do the above steps, you will notice that your cursor modifications and remains a plus icon. You can now click and pull and insert multiple lines in one go.

To unlock the line Of  drawing mode, hit the Escape key.

Customizing Lines/Arrows in Excel

Apart from inserting different types of lines, you can also customize the line shapes you insert.

When you click on any of the line shapes in the worksheet, you will notice a new contextual tab in the ribbon – the Shape Format tab.

Shape Format tab in the Excel ribbon

You get some additional options to format the lines in this new tab.

Shape Styles Options

In This Shapes Styles group, there are some inbuilt theme types and preset styles you can use. To see all these choices, you can click on the More icon.

Click on More shape styling options icon

Then you can select any of the existing styles, and it will be Apply to all the selected lines in the worksheet.

More shape styling options

Apart from this, you can also change the line outline by bonding on the Shape Outline option.Shape outline option

In Shape Outline, you can change the following bellow:

  • Color of the line
  • Weight of the line (thickness)
  • Style of the line (solid, dot, Or dash, etc)
  • Arrows

And finally, you can also add some Effects to the  This line, such as shadow, glow, or reflection. It can be done using the Shape Effect options.

Arranging the Lines

If you’re operating with more than a few line shapes in Excel, you will find it useful to know about the “Arrange” options.

You can discover these in the Arrange group in the Shape Format tab (which only appears when you select any shape in the worksheet).

Shape Arrange options

Following are the options that are available to you:

  • Bring Forward / Send Backward – if you want to rearrange the shapes.
  • Selection Pane – this opens a pane on the right to see all the shapes in the worksheet. You also have the option to hide some shapes from this pane.
  • Align – To align the lines left/center/right or top/middle/bottom. comes in handy when working with multiple shapes where you want these shapes to be neatly aligned
  • Rotate – to change the angle to the line
  • Group – to group multiple lines/shapes. For example, you can group lines and boxes using this so that they will move/size together.

Example 1 – Adding a Line to Connect Boxes/Shapes In Excel

Now that I’ve covered how to insert and format line shapes in Excel, let me show you a couple of examples of how you can use this in real life.
A common example is when you have boxes in the worksheet, and you want to connect these boxes using lines. These could be simple lines or lines with arrows that also deliver the flow
Below I have an example where I own two boxes, and I want to draw lines between these to connect them.

Below are the steps to do this:

  1. Click the Insert tab
  2. Click on Illustrations
  3. Click on Shapes
  4. Click on the Line icon
  5. In the worksheet, click on the right border of the first box and drag the cursor to the left border of the second box.

It will insert a line, and you will get something as shown below Mention .

Boxes connected with arrow

You can also use different styles of the lines, such as pointers or connectors.

Example 2 – Adding a Line in Excel Charts

Apart from connecting boxes and creating flowcharts, arrows are also useful when you want to highlight distinct data points in a chart in Excel.

The Below is an example where I wanted to highlight one specific data point with some context, so  added some text in the chart and then used an arrow to the point that text towards one specific data point.

Line drawn to connect data label to box

You can format the line using the same colors used in the chart or use a contrasting color to make it stand out.

How to Draw a Line in Excel (Using Cursor / Touch)

So far, I have covered how to insert a line shape in Excel that you can drag and drop anywhere in the worksheet and design the colors, thickness, etc.

But there is also an option to draw a line or shape in Excel manually.

The Draw option in Excel allows you to utilize your cursor (or a pen or touch if you have a touch screen) and draw on the screen.

You can use it to draw fast some shapes and lines – such as a simple flow chart or an organization chart.

It won’t look as neat and clean as the shapes that you can insert, but in some cases, it could be quicker and more useful – for example, if you are trying to show a procedure in excel on a call or in a presentation.

You can access these options in the Draw tab in the ribbon, where you can establish the pen (with different colors and thickness) and use it for drawing lines or shapes.

Draw tab in the ribbon

While using the Draw option is quite effortless and self-explanatory, there is one useful feature that I want to highlight – Ink to Shape.

Using the Ink to Shape option, you can draw lines and shapes in the worksheet and then use this option to convert these into neat-looking conditions (such as proper straight lines and boxes/squares/rectangles).

Below is an example of something I pulled using my cursor.

Hand drawn shape

And now below are the steps to convert these hand draw boxes and lines into proper shapes:

  • Click the Select Object option in the Draw tab
  • Select the shapes you want to convert
  • Click on the Ink to Shape option
  • Here is the result I got:

Hand drawn Shape converted to regular boxes

The above option choice tries its best to convert your free-form hand-drawn shapes into proper lines and boxes.

This feature is not perfect; sometimes can’t understand this shapes. But it still works well and can save you a lot of time if you have many hand-drawn shapes that need to be converted.

Scroll to Top