To put a border around cells in Excel for Microsoft 365 on Windows, select the cell or range, then choose Home > Font > Borders and pick a border option, such as Outside Borders or All Borders. Use the Borders menu or the Format Cells dialog to control which edges appear, their line style, and their color. Borders emphasize headings, separate totals, and make tables easier to read; they are different from Excel’s default gridlines.
What You’ll Need
- An Excel workbook with the cells you want to format. Save a copy first if you are applying borders across a large area or changing an existing formatted sheet.
- Access to Excel for Microsoft 365 on Windows. The ribbon steps are similar in Excel for Mac and Excel for the web, though some keyboard shortcuts and interface details differ.
- A clear idea of what you want to outline: a single cell, a selected range, or a whole table. For example, use an outside border to frame a table and inside borders to divide every row and column.
Step-by-Step
- Open the worksheet and identify the target cells. Click the worksheet tab containing the data. Decide whether you want to border one cell, a range, or a table. For a small example, if a table occupies cells A1:D8, you can select that range before choosing a border. You do not need to select the text inside cells; Excel applies borders to the cell boundaries.
- Select the cell or range. Click a cell to format just that cell. To select a rectangular range, click the first cell and drag to the last, or click the first cell, hold Shift, and click the last cell. You can also click the Name Box to the left of the formula bar, type a range such as A1:D8, and press Enter. The selected cells should appear highlighted; Excel’s active cell remains more distinctly outlined.
- Open the Borders menu. On the ribbon, select Home. In the Font group, find the Borders button, usually shown as a small square grid. Click the arrow beside it to open the menu. Clicking the main part of the button instead of its arrow may repeat the most recently used border command, so use the arrow when you need to choose a different option.
- Choose the border that fits the job. Select Outside Borders to draw a frame around the selection without dividing its cells. Select All Borders to add an outline and lines between each selected cell. Bottom Border is useful for a heading or subtotal, while Thick Outside Borders gives a table a stronger frame. The menu can also include top, left, right, double-bottom, and other edge options. The border appears as soon as you click an option.
- Check which edges were added. Look closely at the perimeter and any interior cell boundaries. If you applied Outside Borders to A1:D8, the frame should enclose the range, but the cells inside will not be separated by new borders. If you applied All Borders, lines should divide the cells horizontally and vertically. Click another cell when you are done to see the result without the selection highlight obscuring it.
- Customize line style or color when needed. Open the Borders menu again. To change the line color, point to Line Color and choose a color. To change thickness or pattern, point to Line Style and select an available style. Then choose the edge or preset to apply it to. Depending on the Excel build and menu layout, you may need to select the style or color before clicking an individual border command. Check the result and repeat if a different edge needs a different treatment.
- Use Format Cells for precise borders. Select the cells and press Ctrl+1 on Windows to open Format Cells, then select the Border tab. Choose a line style and color, then use the Presets or click the border positions in the preview diagram. Outline applies an outside edge, and Inside adds interior lines to a multi-cell selection. Click OK to apply the changes. This dialog is especially helpful when you want, for example, a thin inside grid and a thicker outside frame.
- Save and review the worksheet. Press Ctrl+S to save. If the sheet will be printed or shared as a PDF, use Print Preview to confirm that the borders are visible and that the table fits on the page. Borders normally print; worksheet gridlines may not, and they are controlled separately. If you are formatting a large table, check several rows and columns rather than assuming every edge looks right.
On Excel for Mac, select the range and use the Borders control on the Home tab in the ribbon, then choose a border option. The Format Cells dialog is also available from the ribbon or the Mac menu, but keyboard shortcuts differ by keyboard and system settings; use the menus if Ctrl+1 does not open the dialog. In Excel for the web, the Home tab also provides a Borders menu, although some advanced line-formatting controls can vary from the desktop app.
Common Mistakes
- Choosing All Borders when you only wanted a frame. All Borders adds lines between the cells as well as around the edge. For a clean table outline with no internal dividers, select Outside Borders instead.
- Formatting the wrong selection. A border command affects the selected cells, not necessarily the entire visible table. Before applying it, verify the highlighted range or check the Name Box. If the selection is short by one row or column, the missing edge can make the table look unfinished.
- Confusing borders with gridlines. Gridlines are the worksheet’s default cell guides and can be hidden or set not to print. Borders are formatting that you apply to selected cells. Turning gridlines on will not create formatted borders, and applying borders is the better option when a table needs clear lines in printouts.
- Using a very dark or thick line everywhere. Heavy borders around every cell can make a sheet crowded and reduce readability. Reserve thick lines for the outside of a table or an important total, and use lighter interior lines when separation is needed.
- Expecting the selection highlight to be the border. The colored outline around the active selection is a temporary selection indicator. It is not a cell border and will not print. Click elsewhere or open Print Preview to check the actual formatting.
- Removing formatting unintentionally. The Borders menu’s No Border option removes borders from the selected cells, but broad commands such as clearing all formats can also remove number formats, fills, and fonts. Use No Border when borders alone need to be removed.
Tips
- Use a consistent hierarchy. A thin border can separate ordinary rows, while a thicker bottom border can distinguish a totals row. Apply a visual pattern consistently so readers can tell headings, data, and summaries apart.
- Apply a table’s outline and interior lines separately. Select the full range and apply All Borders for a quick grid. If you want a stronger frame, apply a thin All Borders first, then apply Thick Outside Borders to the same range. The outside command changes the perimeter without removing the interior lines.
- Format the whole range at once. Applying a border to a selected range is usually quicker and more consistent than formatting cells individually. For a table that grows regularly, consider using an Excel table from Insert > Table; table styles can provide coordinated formatting, though they are not the same as manually chosen cell borders.
- Keep color contrast high. A pale line may look subtle on screen but disappear when printed or viewed on a different display. Choose a line color with enough contrast against the cell fill, and check the appearance at the zoom level people will use.
- Copy border formatting carefully. Format Painter can copy formatting from one cell or range to another, but it may also copy fills, fonts, and number formats. If you only want to transfer borders, use Paste Special > Formats only when copying all formatting is acceptable, or apply the border directly to the destination range.
- Use borders to clarify structure, not decorate every cell. A line above a subtotal or around a key input area can guide the eye. Too many combinations of colors, weights, and styles make it harder to interpret which boundaries matter.
Troubleshooting
- No border appears after you click a command. Confirm that the intended cells are selected and that you chose a border option rather than opening the menu and closing it. Try a visible option such as Thick Outside Borders as a quick test. If it appears, reopen the menu and apply the preferred style or color.
- The line is difficult to see. A thin, light-colored line can blend into the cell fill or display at a low zoom level. Select the range, open the Borders menu, choose a darker Line Color or a more visible Line Style, and apply the edge again. You can also use Format Cells to inspect the preview and confirm which edges are enabled.
- Only some edges are present. The preset may have added only the bottom, top, or outside edges. Select the complete target range and apply All Borders if you need every cell divided. For a custom layout, open Format Cells > Border and click each required edge in the preview rather than repeatedly guessing at menu options.
- The border is missing in a printout. Check Print Preview and confirm that the border is actual cell formatting, not just a gridline or selection outline. If it is formatted but too faint, choose a darker or heavier line. Also check that the relevant cells are included in the print area and that scaling has not made the content too small to read.
- Existing borders do not change as expected. Verify the selected range and apply the new border to the same edges. A border command may affect only a particular edge rather than replacing every edge in the selection. To start over, select the range, choose No Border, and then apply the desired combination. This removes borders only, but inspect the range first so you do not erase a carefully designed layout.
- The ribbon looks different or a shortcut does not work. Ribbon placement can vary with window size, app version, and platform. Maximize the window or look for the Borders control in the Home tab’s Font group. On Windows, Ctrl+1 opens Format Cells; on Mac, use the dialog through the menus or ribbon if that shortcut is unavailable or assigned differently.
Frequently Asked Questions
How do I put a border around a whole table?
Select all cells in the table, open Home > Font > Borders, and choose Outside Borders. This frames the range without adding interior lines. Choose All Borders instead if you also want to divide each cell.
How do I add borders to every cell in a range?
Select the complete range and choose All Borders from the Borders menu. Excel adds the outside edges and lines between selected cells. Verify the selection first so the final row and column are included.
How do I remove a border without deleting cell contents?
Select the cells, open the Borders menu, and choose No Border. This removes border formatting but keeps the values and formulas. Avoid a command that clears all formatting if you want to preserve fills, fonts, and number formats.
Can I change a border’s color or thickness?
Yes. Open the Borders menu and choose an available option under Line Color or Line Style, then apply it to the desired edge. For greater control, select the cells, open Format Cells > Border, choose the style and color, and set the edges in the preview.
Why do my cell borders not show when I print?
Make sure you applied cell borders rather than relying on gridlines or the selection outline. Check Print Preview, confirm the cells are included in the print area, and use a darker or thicker border if the line is too faint at the printed size.
Will adding borders change my data or formulas?
No. Borders change the visual formatting of cells; they do not alter cell values or formulas. They can, however, make a busy worksheet easier to scan when used consistently and sparingly.
Related
- How to Merge Names in Excel From Two Cells With a Space
- Merge Cells in Excel Using Keyboard: Shortcuts & Steps
- Merge Cells in Excel Without Losing Data: Safe Steps
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- Insert an E-Signature in Word: Steps and OptionsTo insert an e-signature in Microsoft Word, add a picture of your handwritten signature with Insert > Pictures,…
- Excel Redo Shortcut: How to Reapply an ActionIn Excel for Microsoft 365 on Windows, press Ctrl+Y to redo the last action you undid. On a…
- Google Sheets Data Validation: Rules, Lists, and TipsGoogle Sheets data validation lets you control what people can enter in selected cells, using dropdowns, checkboxes, or…
- Combine Cells in Excel: Shortcut and Safe StepsTo merge selected cells in Excel for Microsoft 365 on Windows, select the range and press Alt, H,…
- Heat Map Examples in PowerPoint: Ideas and How to Make ThemHeat map examples in PowerPoint include a sales-by-region matrix, a weekly activity calendar, a survey response grid, and…
- Excel Drag Fill: Shortcut Keys and How to Use ThemTo drag-fill in Excel, select a cell, point to the small square at the lower-right corner of its…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.