To add border lines in Excel for Microsoft 365 on Windows, select the cells, go to Home > Font > Borders, and choose a border style such as Outside Borders or All Borders. Use the same menu to change or remove borders; these lines are cell formatting, not the worksheet gridlines Excel displays by default.
What border lines do in Excel
A cell border is a formatting line applied to one or more cell edges. It can outline a cell or a group of cells, divide rows or columns, or emphasize a particular edge. Borders are useful for making headings, totals, input areas, and report sections easier to scan. Unlike a value or formula, a border does not change the contents or calculations in a cell.
Excel lets you choose which edges receive a border, along with its color and line style. You can place borders around the outside of a selected range, add lines between the cells inside it, or format only selected sides. For example, an outside border around A1:D8 frames a table, while All Borders adds lines around each cell in that range.
Border choices are available from the Borders menu in the Home tab’s Font group. They are also available in the Format Cells dialog, which provides more detailed controls. Borders can be applied to blank cells as well as cells containing data, so you can prepare a form or report layout before entering information.
How to add a basic border
For a quick outline, select the cell or range and choose Home > Font > Borders > Outside Borders. Excel applies an outline to the selection without adding dividers between its cells. For a full grid around every selected cell, choose All Borders instead.
To apply a border with a specific color or line weight, open the Borders drop-down and use the style or color choices before selecting the border placement. Menu labels and layout can vary slightly with window size and Excel updates, but the controls are in the Home tab’s Font group. The selected border appears on the worksheet as soon as you choose it.
- Outside Borders: adds an outline around the selected range.
- All Borders: outlines each cell and adds internal horizontal and vertical lines.
- Bottom Border: adds a line under each selected cell, often used to separate a heading from the data below.
- Top Border: adds a line above the selection, useful for distinguishing a total row.
- No Border: clears borders from the selected cells.
On Windows, you can use ribbon KeyTips instead of clicking: press Alt, then H to open Home commands, then B for the Borders menu, and follow the letter shown for the border option you want. The final KeyTip can vary by Excel build or menu state, so use the on-screen letter rather than relying on a memorized sequence. On Mac, use the Borders menu on the Home tab or open Format > Cells and select the Border tab; Windows Alt KeyTips do not apply in the same way.
Choose border sides, color, and line style
The Borders drop-down is convenient for common choices, but the Format Cells dialog is better when the design needs precision. Select the cells, open Format Cells, and choose the Border tab. On Windows, Ctrl+1 opens Format Cells; on Mac, Command+1 opens the corresponding dialog in supported Excel versions. You can also open Format Cells from the Home tab’s Font group dialog launcher.
In the Border tab, first choose a line style and, if needed, a color. Then use the preview controls to apply the line to particular edges, inside horizontal or vertical divisions, or the range outline. The preview helps you see which sides are selected before you confirm. Choosing a color or style by itself does not necessarily draw a line: you must also apply it to an edge or use one of the preset buttons.
For a simple expense sheet, for example, you could select the column headings and apply a bottom border, then select the final total row and use a top border. This creates visual separation without drawing a box around every data point. For a printed application form, a thin outline around each blank input cell may be more useful.
Apply borders to ranges and tables
Excel applies borders to the cells you select, so range selection determines the result. If you select B2:E10 and choose Outside Borders, the outline surrounds the entire block. If you choose All Borders, each cell in B2:E10 gets an outline, including the internal boundaries. Selecting an entire row or column applies formatting to all of its cells, not just the visible portion of a data set.
For a table with a heading row, data rows, and a total, consider using a small number of deliberate borders:
- Put a bottom border under the column headings.
- Use a top border above a subtotal or grand total.
- Use an outside border to frame a compact report area.
- Add internal borders only when readers need to distinguish individual cells.
Excel tables created with Insert > Table can also use built-in table styles, many of which include banded rows and visual separators. Those styles are not identical to manually applied cell borders. A table style changes the table’s appearance as a whole and can adapt as rows are added; a manually applied border is direct cell formatting. If a table style and manual formatting appear to conflict, inspect the Table Design options and the individual cell formatting to identify which appearance is in effect.
Borders versus worksheet gridlines
Gridlines are the faint cell guides Excel normally shows across a worksheet. They help you follow rows and columns while working, but they are not saved as cell borders and are not a reliable way to frame a finished report. Turning gridlines off does not remove borders, and applying borders does not turn gridlines off.
To show or hide worksheet gridlines in Excel for Windows, use View > Show > Gridlines. The checkbox controls the display for the current worksheet. In Excel for Mac, use the View tab’s gridline control. If the worksheet looks blank after gridlines are hidden, borders or fill colors can make the important cells visible again.
This distinction also explains why a worksheet can look divided on screen but print without visible cell boundaries: the visible guides may only be gridlines. If you need lines in a printed report, apply actual borders to the relevant cells or enable gridline printing for the sheet.
Print border lines and gridlines
Cell borders normally print as part of the worksheet formatting. Gridlines, by contrast, have their own print setting and are commonly excluded from printouts by default. On Windows, open Page Layout and, in the Sheet Options group, select the Print checkbox under Gridlines if you want gridlines printed. The same area also controls whether gridlines are displayed on screen. On Mac, look for the gridline print option on the Page Layout tab; the exact arrangement can differ by version.
Before printing, check the result with File > Print and review the preview. A border can be too light or too thin to reproduce clearly, especially on a printer that uses draft or economy settings. A darker color or a slightly heavier line may improve readability, but avoid heavy borders around every cell if they make a dense report harder to read. Page scaling and print area settings can also affect how a report fits on paper, though they do not change the border formatting itself.
Edit, copy, or remove borders
To change a border, select the affected cells and choose a different edge, color, or line style. Applying a new border to one side does not automatically remove borders from other sides. If the result looks cluttered, select the range and choose No Border, then add back only the lines you need. Clearing borders removes border formatting; it does not delete cell values, formulas, fills, or number formats.
You can copy border formatting along with other cell formatting. Use Home > Clipboard > Format Painter, select the formatted cell or range, and drag or click over the destination. Format Painter may copy fills, fonts, number formats, and other formatting as well as borders, so it is not ideal when you need to transfer borders alone. For a precise border-only change, apply the border from the menu or Format Cells dialog directly.
Copying and pasting cells can also carry borders, depending on the paste option. If copied data brings unwanted formatting, use Paste Options such as Values or Formulas where appropriate, or clear formatting from the destination and reapply the intended design. The exact options shown depend on what was copied and the version of Excel.
Common border problems and fixes
- A line is visible but will not print: it may be a worksheet gridline rather than a cell border. Apply an actual border, or turn on gridline printing in Page Layout.
- Some edges are missing: the selected preset may add only an outline or only one side. Open Format Cells > Border and inspect the preview, or choose All Borders if internal lines are wanted.
- The border looks different from the selected style: check the selected cells and the dialog preview. A neighboring range may have its own formatting, and a table style may also affect the display.
- Old lines remain after changing the style: applying a new edge does not clear every other edge. Choose No Border for the range first, then build the desired border layout again.
- Lines appear too faint: change the border color or line style and check the print preview. Screen zoom, display settings, and printer output can make thin lines appear lighter.
When formatting a large sheet, it is usually easier to select only the report area than to apply borders to entire rows or columns. Broad formatting can make the workbook harder to navigate and may create visual clutter when more data is added later.
Frequently Asked Questions
How do I put a line under text in an Excel cell?
Select the cell and choose Home > Font > Borders > Bottom Border. This draws a border along the bottom edge of the cell; it is different from underlining the characters themselves.
How do I add borders to every cell in a selection?
Select the range, then choose Home > Font > Borders > All Borders. Excel applies lines around the outside and between the selected cells.
Why do my Excel gridlines not show when I print?
Gridlines are usually not included in printouts unless you enable their print setting. In Windows, go to Page Layout > Sheet Options and select Print under Gridlines. Actual cell borders normally print without that setting.
Can I change border color in Excel?
Yes. Open the Borders drop-down, choose a border color, and then apply a border edge. For detailed control over color, weight, and placement, use the Border tab in Format Cells.
How do I remove all borders without deleting data?
Select the cells and choose Home > Font > Borders > No Border. This removes the border formatting from the selection while leaving its contents and other formatting in place.
Related
- Attendance Roster Template in Excel: Setup and Tips
- Attendance Point Tracking Excel Template?
- Attendance Point System Template Excel: Build and Use
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- Excel Find and Delete Text: Replace, Clear, or RemoveTo find text in Excel and remove it, press Ctrl+H, enter the text in Find what, leave Replace…
- Excel Group Duplicate Rows Without Losing DataTo group duplicate rows in Excel, first decide what makes two rows duplicates, then sort by those columns…
- Excel Number to Words: How to Spell Out Cell ValuesExcel does not have a built-in function that converts a number into words. In Excel for Microsoft 365…
- How to Put Emails in Archive in Outlook on Any DeviceTo put an email in the Outlook archive, select the message and choose Archive. Outlook removes it from…
- Lock Cells in Excel: Protect and Unlock a WorksheetYes. In Excel for Microsoft 365 on Windows, select the cells people should be able to edit, open…
- Excel Template for Quotation Comparison: Build OneIn Excel for Microsoft 365 on Windows, create supplier columns in B:D, enter each quote’s comparable costs in…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.