How to Put a Border Around Cells in Excel
In this article
To put a border around cells in Excel, select the cells, go to the Home tab, click the Borders drop-down in the Font group, and choose a border style such as Outside Borders or All Borders. For more control, open Format Cells (Ctrl+1 on Windows, Command+1 on Mac) and use the Border tab to pick line style, color, and which edges to apply. That is the short answer; the steps below cover the exact clicks, the differences between Excel for Windows, Mac, and the web, and how to fix the usual snags.
What You'll Need
- Excel for Microsoft 365, Excel 2021, 2019, or 2016 on Windows or Mac, or Excel for the web. The border controls are in the same place across these versions, though labels and ribbon layout can differ slightly by version, device, and region.
- A workbook with at least one worksheet containing data or blank cells you want to outline.
- Optional: a printer or PDF export if you want to check that borders print correctly.
Step-by-Step
- Select the cells. Click the first cell, then drag to the last cell, or hold Shift and click the last cell. To border an entire row or column, click the row number or column letter. To border a whole used range quickly, click any cell in the data and press Ctrl+A (Windows) or Command+A (Mac) once; pressing it twice selects the entire sheet, which is usually not what you want.
- Go to the Home tab. The Borders button lives in the Font group, next to the fill color and font size controls. On a narrow window or small screen, the Font group may collapse into a single button; click the small arrow to expand it.
- Open the Borders drop-down. Click the arrow next to the Borders icon (it looks like a window pane). A gallery appears with options such as Bottom Border, Top Border, Left Border, Right Border, No Border, All Borders, Outside Borders, Thick Box Border, Bottom Double Border, and More Borders.
- Choose the border you want. For a single outline around the selected block, pick Outside Borders. For a grid on every cell, pick All Borders. For a heavier outline, pick Thick Box Border. The border applies immediately to the current selection.
- For custom line style, color, or specific edges, open Format Cells. Press Ctrl+1 (Windows) or Command+1 (Mac), or right-click the selection and choose Format Cells. Go to the Border tab. Here you can pick a line style (thin, medium, thick, dashed, dotted, double), choose a color from the Color drop-down, then click the edge buttons in the preview (Top, Bottom, Left, Right, Inside, Outside) to apply that style to those edges. Click OK to apply.
- Check the result and adjust. If a border is missing, reselect the cells and reapply. Borders are formatting only; they do not add or remove data, and they do not affect calculations.
- Copy the border to other cells if needed. Use the Format Painter on the Home tab: select a bordered cell, click Format Painter, then drag over the target cells. Alternatively, copy the cell (Ctrl+C) and use Paste Special > Formats.
- Verify printing. Go to File > Print or press Ctrl+P and check the preview. Borders normally print, but if gridlines are what you see on screen and not borders, the printout may lack lines. In that case apply real borders rather than relying on gridlines.
Common Mistakes
- Confusing gridlines with borders. The faint lines on screen are gridlines and do not print by default. To print lines, either apply borders or enable Print Gridlines under Page Layout > Sheet Options. Borders are the reliable choice for tables you share or print.
- Bordering only one cell when you meant the block. If you select a single cell and choose Outside Borders, only that cell gets an outline. Select the full range first.
- Using All Borders when you wanted an outline. All Borders draws lines between every cell, which can look busy. Outside Borders gives a single frame around the selection.
- Applying a border color that is too light. A pale gray or white border can be invisible on screen or in print. Choose a color with enough contrast against the cell fill.
- Expecting borders to follow sorted or filtered data. Borders are attached to cells, not to records. Sorting moves values but can leave borders behind or misaligned. Reapply borders after major rearrangements, or format as a table (Insert > Table) so banding and outlines stay consistent.
- Forgetting that merged cells behave differently. A border around a merged cell applies to the merged area, but borders inside merged ranges can be tricky. Unmerge, apply borders, then merge again if the result looks wrong.
Tips
- Use keyboard shortcuts to speed up: Ctrl+Shift+& (ampersand) applies an outline border to the selection on Windows; Ctrl+Shift+_ (underscore) removes borders. On Mac, the menu path Format > Cells > Border is the reliable route.
- For dashboards and reports, use a thick outside border and thin inside borders. This draws the eye to the table edge without clutter.
- If you border many separate ranges, copy a formatted cell and use Paste Special > Formats to replicate the look quickly.
- Borders are part of cell formatting, so they travel with the cell when you copy it to another workbook, provided you paste formats or paste all.
- To remove all borders, select the range and choose No Border from the Borders drop-down, or use the eraser option in the Format Cells Border tab.
- When sharing a workbook, remember that borders are visual only. If you need structure that resists editing, consider formatting the range as a table or protecting the sheet.
Troubleshooting
- The border does not appear. Check that you selected the right cells and that the border color is not white or the same as the fill. Also confirm you are not in a view that hides formatting, such as Page Break Preview, where some formatting may look different.
- Borders disappear after pasting. A normal paste may bring values only. Use Paste Special > Formats, or choose Keep Source Formatting from the paste options that appear after pasting.
- Borders look uneven after inserting or deleting rows. Excel extends formatting in some cases and not others. Reselect the range and reapply the border style.
- Borders do not print. In the Print preview, check that the print area includes the bordered cells. Under Page Layout > Sheet Options, confirm Print Gridlines is set as you expect, and check that the printer is not set to a draft mode that drops thin lines.
- The Borders button is grayed out. This usually means the sheet is protected or the workbook is in a mode that restricts formatting. Review the sheet protection settings (Review > Unprotect Sheet) if you have the password, or check whether the file is read-only.
- Only part of the selection gets a border. Hidden rows or columns, or merged cells, can break the visual result. Unhide rows and columns (select the surrounding headers, right-click, Unhide) and check for merges before reapplying.
Frequently Asked Questions
How do I put a border around an entire row or column?
Click the row number or column letter to select it, then use the Borders drop-down and choose the border you want. For a full grid on a column, All Borders works; for a single outline, Outside Borders.
Can I apply different border styles to different sides of the same cell?
Yes. Open Format Cells (Ctrl+1 or Command+1), go to the Border tab, choose a line style and color, then click the specific edge buttons in the preview. You can set a thick bottom border and a thin top border on the same cell.
Do borders print by default?
Borders you apply do print, as long as the cells are within the print area. Gridlines are separate and do not print unless you enable Print Gridlines under Page Layout > Sheet Options.
How do I remove all borders from a range?
Select the range, open the Borders drop-down, and choose No Border. Alternatively, use Format Cells > Border and click the None preset, then OK.
Why does my border disappear when I sort the data?
Borders belong to cells, not to rows of data, so sorting can move values away from their formatting. Reapply borders after sorting, or convert the range to a table so formatting stays consistent.
Can I save a border style for reuse?
Excel does not have a named border style gallery like some design apps. The practical approach is to format a cell the way you want and use the Format Painter or copy and Paste Special > Formats to reuse it.