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.
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:

Figure 1. The Border tab of the Format Cells dialog box.
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.
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!
Excel allows you to apply several types of alignments to cells. One type of alignment allows you to indent cell contents ...
Discover MoreIt 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 MoreIf you want information to display on the screen using fractions instead of decimals, you're in luck. Excel provides ...
Discover MoreFREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
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.
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.
FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
Copyright © 2026 Sharon Parq Associates, Inc.
Comments