Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, 2013, 2016, 2019, 2021, 2024, and Excel in Microsoft 365. If you are using an earlier version (Excel 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Excel, click here: Adding Diagonal Borders.

Adding Diagonal Borders

Written by Allen Wyatt (last updated August 8, 2026)

4

Excel allows you to add all sorts of borders to cells in a worksheet. You can place borders on the left, right, top, and bottom of a cell. If you select a range of cells, you can add borders to the left, right, top, bottom, and in between, meaning that the borders could be between cells within the selected range.

Many people don't realize that you can also place diagonal borders. This means that a border can appear from the top-left to the lower-right corners of a cell, or from the top-right to the lower-left. To take advantage of diagonal borders, follow these steps:

  1. Press either Ctrl+1 or Ctrl+Shift+F. Excel displays the Format Cells dialog box.
  2. Make sure the Border tab is selected. (See Figure 1.)
  3. Figure 1. The Border tab of the Format Cells dialog box.

  4. At the bottom left and right corners of the Preview area of the dialog box you should see buttons that have diagonal lines on them. Click the line that represents the type of diagonal border you want to use.
  5. Click on OK.

Diagonal borders can only be applied to cells, not to rectangular areas you select onscreen. For instance, if you choose cells A5:C12, the diagonal border won't go from the top-left corner of cell A5 to the bottom-right corner of cell C12. Instead, it is applied to the individual cells within the selected range.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (6152) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, 2021, 2024, and Excel in Microsoft 365. You can find a version of this tip for the older menu interface of Excel here: Adding Diagonal Borders.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Inserting the User's Name

Word keeps track of a name for the person using the program. If you want to add this person's name into the document, ...

Discover More

Specifying Different Weekends with NETWORKDAYS

The NETWORKDAYS worksheet function can be used to easily determine the number of work days (Monday through Friday) within ...

Discover More

Checking for Text

Need to figure out if a particular cell contains text? You can use the ISTEXT function to easily return this bit of trivia.

Discover More

Solve Real Business Problems Master business modeling and analysis techniques with Excel and transform data into bottom-line results. This hands-on, scenario-focused guide shows you how to use the latest Excel tools to integrate data from multiple tables. Check out Microsoft Excel Data Analysis and Business Modeling today!

More ExcelTips (ribbon)

Indenting Cell Contents

Excel allows you to apply several types of alignments to cells. One type of alignment allows you to indent cell contents ...

Discover More

Automatically Changing a Cell's Background Color

It is often desired to change what is displayed in a cell based on what is in a different cell. What if what you want to ...

Discover More

Using Fractional Number Formats

If you want information to display on the screen using fractions instead of decimals, you're in luck. Excel provides ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is 5 + 5?

2026-08-17 07:45:34

Mike J

@ Michael

You can achieve the visual effect you want, but you have to merge the cells first. It works with larger rectangles too, but maybe not what you needed.


2026-08-09 15:30:26

J. Woolley

@Michael
To add a line from the top-left corner of A1 to the bottom-right corner of B1:
1. Pick Insert > Illustrations > Shapes and click the Line shape.
2. Click-drag from the top-left corner of A1 to the bottom-right corner of B1.
The line remains anchored to those corners even if rows/columns are inserted or cells are resized.


2026-08-09 10:34:42

J. Woolley

@Michael
This won't add a diagonal from A1 to B1 as you requested, but it might be interesting to someone:
The Tip says, "...the diagonal border...is applied to the individual cells within the selected range." While pressing Ctrl, click each cell along the diagonal for a non-contiguous selection like (A1,B2,C3,D4,E5,F6), then add a diagonal border as described in the Tip; that border will apply to all cells in the selection (see Figure 1 below)
In this case I used My Excel Toolbox's SetColumnWidthPixels macro to match the 40 pixel row height, making the cells square.
See https://sites.google.com/view/MyExcelToolbox/


Figure 1. 




2026-08-08 09:24:45

Michael

Simple diagonals are .... simple enough.

How about a diagonal over two or more cells, for example starting in the upper left hand corner of cell A1 and extending to the lower right hand corner of B1? Is there a way? Don't think so without using a line drawn on top of grid? Then that can be mistaking moved of position often if touched inadvertently.


This Site

Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.